Core java tutorial for beginners
A tutorial blog which explains different core concepts related to Java along with programming examples
Subscribe to Startertutorials.com's YouTube channel for different tutorial and lecture videos.

Categories: IO. No Comments on Character stream classes in Java with examples
0
(0)

The character stream or textual I/O classes deals with reading characters or writing characters to a target or destination stream. They can be used for reading or writing characters to text-based files like XML, HTML, JSON etc.
 

The character stream abstract base classes are Reader and Writer. The input character stream class hierarchy is shown in the below figure.

Input character stream classes in Java
 

The description of these input character stream classes is provided in the below table:

Stream class Description
Reader This is an abstract base class for all input character stream classes.
BufferedReader An input character stream class which is faster than other input stream classes.
CharArrayReader An input character stream class for reading array of characters as an input stream.
FilterReader An abstract character byte stream class for filtering character input streams.
InputStreamReader An input character stream class for converting input byte stream to characters.
PipedReader An input character stream class for reading characters from a pipe.
StringReader An input character stream class for reading characters from a string as input stream.
PushBackReader An input character stream class which can be used to look ahead in the character input stream.
FileReader An input character stream class for reading characters from a file.

 

Visit the following link for sample Java programs for reading characters from a file using character stream classes like BufferedReader and FileReader.

 


Subscribe to our monthly newsletter. Get notified about latest articles, offers and contests.


The output character stream class hierarchy is shown in the below figure.

Output character stream classes in Java
 

The description of these Output character stream classes is provided in the below table:

Stream class Description
Writer This is an abstract base class for all output character stream classes.
BufferedWriter An output character stream class which is faster than other output stream classes.
CharArrayWriter An output character stream class for writing array of characters as an output stream.
FilterWriter An abstract character byte stream class for filtering character output streams.
OutputStreamWriter An output character stream class for converting character to output byte stream.
PipedWriter An output character stream class for writing characters to a pipe.
StringWriter An output character stream class for writing characters to a string as output stream.
FileWriter An output character stream class for Writing characters to a file.

 

Visit the following link for sample Java programs for writing characters to a file using character stream classes like BufferedWriter and FileWriter.

 

For more information, visit the following links:

How useful was this post?

Click on a star to rate it!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Suryateja Pericherla

Suryateja Pericherla, at present is a Research Scholar (full-time Ph.D.) in the Dept. of Computer Science & Systems Engineering at Andhra University, Visakhapatnam. Previously worked as an Associate Professor in the Dept. of CSE at Vishnu Institute of Technology, India.

He has 11+ years of teaching experience and is an individual researcher whose research interests are Cloud Computing, Internet of Things, Computer Security, Network Security and Blockchain.

He is a member of professional societies like IEEE, ACM, CSI and ISCA. He published several research papers which are indexed by SCIE, WoS, Scopus, Springer and others.

Note: Do you have a question on this article or have a suggestion to make this article better? You can ask or suggest us by filling in the below form. After commenting, your comment will be held for moderation and will be published in 24-48 hrs.

Leave a Reply

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