SLIDE 22 SSC1: I/O Volker Sorge Overview I/O Streams
Basic Streams Data Streams
Standard Streams
I/O Redirection
Cmd Line Input Formatted I/O
Formatted Output Formatted Input
Buffered Streams Memory Mapping File System Manipulations Polling
Redirecting stdout
◮ Similar to stdin we can redirect stdout java makeIntFile outfile > outfile2 ◮ This command will
◮ read integers from the console, ◮ write them to the file outfile, ◮ saves everything that would be printed to the console to
◮ E.g., everything that is printed using
System.out.println ends up in outfile2
◮ Observe that outfile and outfile2 will be different.
In particular the former is a binary file, while the latter is ASCII.