Advise for a fresher
Do not expect command on Java I/O Streams overnight. It is ocean, until and unless not properly approached, it leaves in a very great confusion, of course without pointers (feeling of when you lost alone in an unknown forest). It is a ocean due to number of classes, and these classes are given to make your programming easy (not to confuse you). I feel the following is a better way to penetrate into Java Input/Output Tutorial; follow the following order of reading.
- A) General Programs
- Java I/O Streams – Overview
- Byte streams and Character streams
- Byte streams vs Character streams
- Semantics of File Copying
- Performance drawbacks of file copying
- BufferedInputStream and BufferedOutputStream
- Chaining of Streams
- DataInputStream and DataOutputStream – File Copying
- Skipping a part of a File
- Keyboard Input – DataInputStream
- Keyboard Input – BufferedReader
- Keyboard Input – Scanner – No parsing
- Scanner – Checking for Tokens
- SequenceInputStream – Merging Files
- ByteArrayInputStream
- ByteArrayOutputStream
- StringBufferInputStream
- Using markSupported(), mark() & reset()
- PrintStream
- Filter Streams in java.io Package
- Giving Line Numbers – LineNumberInputStream
- File Copying – FileReader & FileWriter
- BufferedReader & BufferedWriter
- CharArrayWriter – Storing Data
- StringReader
- StringWriter – Storing Data
- CharArrayReader – Reading from Character Array
- PrintWriter – Formatting Data
- PushbackReader – Pushing out Character
- Using OutputStreamWriter
- RandomAccessFile – Reading Sequentially and Randomly
- LineNumberReader – Giving Line Numbers
- PipedInputStream and PipedOutputStream
- File class – Retrieving Metadata of File
- File class – Changing File Properties
- StreamTokenizer – Tokenizing a Stream
- Performance tips in file copying
Keyboard Input (Scanf in Java)
- B) Compare and Contrast I/O classes. Important for Interviews.
- Byte streams vs Character streams
- PrintStream vs PrintWriter
- StringWriter vs StringBuilder
- StreamTokenizer vs StringTokenizer
- C) Miscellaneous increasing your programming skills.
- System.out.println()?
- What is System.in?
- Closeable and Flushable interfaces
- Number of Lines in a File
- Reading and writing arrays and strings
- Wrapper Streams
- Filter Streams
- Byte streams vs Character streams