Course Content
Core Java
About Lesson

Java programs perform I/O through streams. A stream is an abstraction that either produces or consumes information. A stream is linked to a physical device by the Java I/O system.

All streams behave in the same manner, even if the actual physical devices to which they are linked differ. Thus, the same I/O classes and methods can be applied to different types of devices.

Depending on the data a stream contains, the stream can be categorized into

  1. Byte Stream: It handles input and output of raw binary data. They are used for reading and writing binary data, such as images, audio files, or any other type of non-text data. Byte Stream process one byte at a time.
  2. Character Stream: It handle input and output of character data, automatically handling character encoding and decoding. They are used for reading and writing text data, ensuring the correct handling of different character encodings (like UTF-8, UTF-16).

Character: used to represent textual data. It can be a letter, digit, punctuation mark, or any other symbol. Character streams handle data as characters and use character encoding schemes (like UTF-8, UTF-16) to map between the binary data (bytes) and characters.

Scroll to Top