Stream class in Java

Stream class:

The java.io package contains a large number of stream classes that provide capabilities for processing all types of data. These classes are classified into two types:

  • Character Stream Classes
  • Byte Stream Classes

Character stream class in Java:

It is used to read and write 16-bit Unicode characters. This stream is also classified into two types:

i. Reader stream classes: These are used to read characters from the files.

ii. Writer stream classes: These are used to perform all output operations on the file.

Byte stream classes in Java:

It is used to provide functional features for creating and manipulating streams and files for reading and writing bytes. These classes are classified into two types:

i. Input stream classes: These are used to read 8-bit bytes including a superclass and several subclasses for supporting various input-related functions.

ii. Output stream classes: These are used to perform all output operations.