Java Input/output
Java I/O is supported by classes and interfaces under the Java.io package, the most important of which is the 5 classes, File,outputstream,inputstream, Write,reader, and an interface serializable.
File class: The ability to manipulate files
BYTE stream: (Outputstream/inputstream), you can use the byte stream to read the file contents
Character stream: (Writer/reader)
Convert stream: (Inputstreamreader/outputstreamwriter) converts a byte stream to a character stream
Buffered stream: (BufferedReader), reads the contents of the buffer
Memory Operation Flow: (Bytearrayinputstream/bytearrayoutputstream), which can interact with the memory data rows
Print Flow:
Scanner class: Input to input, can also validate data
Merge flow: (Sequenceinputstream) class can combine two file contents into one file
Compress stream: Compress operations on files
Serializable interface: Serialization of objects
Input byte stream level:
InputStream (parent Class): Bytearrayinputstream,fileinputstream,stringbufferinputstream,sequenceinputstream, Objectinputstream,filterinputstream (Bufferedinputstream,datainputstream,linenumberinputstream, Pushbackinputstream) [Sub-class]
Output byte stream level:
OutputStream (parent Class): Bytearrayoutputstream,fileoutputstream,objectoutputstream,pipedoutputstream, Filteroutputstream (Bufferedoutputstream,dataoutputstream,pintstream) [Sub-class]
Enter the hierarchy of the character stream class:
Reader (parent Class): BufferedReader (LineNumberReader), Chararrayreader,filterreader (Pushbackreader), InputStreamReader ( FileReader), Pipedreader,stringreader
The level of the output character stream class:
Writer (parent Class): Bufferedwriter,chararraywriter,filterwrite,outputstreamwrite (FileWriter), Pipedwriter,printwriter, StringWriter
In addition to the "flow" in the java.io package, there is also a built-in flow in the Java.lang package, the System class, which contains 3 predefined stream variables, in,out and err, which are public and static, This means that you can call directly without the object of the System class. System.out is the standard output stream, which is output to the monitor by default. System.in is the standard input stream, which, by default, is the input keyboard data. System.err is the standard error stream, and the default is to output to the monitor.
Java Input/output