Java - IO - Standard Streams

> Procedural Languages > Java > Java - IO (Input/Output) - (File System|File|Console)

1 - About

3 - Management

3.1 - Manipulation

For historical reasons, Standard Streams are byte streams and not character streams

  • System.out and System.err are defined as PrintStream objects. PrintStream is technically a byte stream but emulate many of the features of character streams (println,…)
  • is a byte stream with no character stream features. To use Standard Input as a character stream, wrap in InputStreamReader.
InputStreamReader in = new InputStreamReader(;

3.2 - Reassignment

3.3 - Read a pipe redirection in the main class

int counter = 0;
int input;			}
	System.out.println(counter+ " - "+input+" char ("+(char) input+")");

3.4 - Printing on the same line

Whatever ... \r

The \r carriage return move the cursor back to the beginning of the line.

System.out.print() (not System.out.println() that adds a end of line)