CSC108 Lecture Notes (Meng Sun)

A First Look at Standard Input

Input/Output


The BufferedReader class is used for reading in input.
 

Processing Streams


Processing streams do reading and writing.  They perform some sort of operation, such as buffering or character encoding, as they read and write.

In this section, we want to focus on the input process.  The table below gives some java.io's processing streams which are related to standard input.
 
Process CharacterStreams
Buffering BufferedReader,
...
Converting between
Bytes and Characters
InputStreamReader,
...

The processing streams are briefly described here:

BufferedReader
Buffer data while reading or writing, thereby reducing the number of accesses required on the original data source. Buffered streams are typically more efficient than similar nonbuffered streams.
InputStreamReader

Keyboard Input Handling