What is IO streams
IO: input (input), output (output).
Regardless of the input or output has its source and destination.
For Java, the input means is where to where it? Output refers to where to where it?
Java in the input: the data read from the file (or network) into the program.
Java in the output: the writer in the data to a file (or network).
IO in Java
Input and output streams in Java are two broad categories: byte stream, a stream of characters
classification | Character-input stream | Character-output stream | Input stream of bytes | Byte output stream |
---|---|---|---|---|
Abstract superclass | Reader | Writer | InputStream | OutputStream |
Access files | FileReader | FileWriter | FileInputStream | FileOutputStream |
Buffer flow | BufferedReader | BufferedWriter | BufferedInputStream | BufferedOutputStream |
data flow | DataInputStream | DataOutputStream | ||
Object flow | ObjectInputStream | ObjectOutputStream | ||
Conversion flow | InputStreamReader | OutputStreamWriter | ||
Print streams | PrintWriter | PrintStream |