byte stream and text stream

byte stream and text stream

Classification of streams is ‘byte stream’ and ‘text stream’. Byte streams represents data in the form of individual byte. Text stream represent data as characters of each 2 bytes. If a class name ends with the word ‘Stream’, then it comes under the byte streams. InputStream reads bytes and OutputStream writes bytes.¬†For example,

FileInputStream

FileOutputStream

If a class name ends with the word ‘Reader’ or ‘Writer’ then it is taken as a text stream. Reader reads texts and Writer writes text. For example,

FileReader

FileWriter

The important classes of byte stream are shown as follows:

 

Untitled

byte stream classes for reading data

 

Untitled

byte stream classes for writing data

 

The important classes of character stream are shown as follows:

Untitled

text stream classes for reading data

Untitled

text stream classes for writing data

Leave a Reply

Your email address will not be published. Required fields are marked *