DEV Community

Pramod Bablad
Pramod Bablad

Posted on

Byte Stream Vs Character Stream In Java

Byte Stream In Java :

  1. They process the data byte by byte i.e 8 bits at a time.
  2. They read/write data 8 bits maximum at a time.
  3. They are most suitable to process binary files.
  4. All byte stream classes in Java are descendants of InputStream and OutputStream.

Character Stream In Java :

  1. They process the data character by character.
  2. They read/write data 16 bits maximum at a time.
  3. They are most suitable to process text files.
  4. All character stream classes in Java are descendants of Reader and Writer.

Below image shows some important byte stream classes and character stream classes in Java.

Image description

Source : https://javaconceptoftheday.com/byte-stream-vs-character-stream-in-java/

Top comments (0)