=======i/o==========================================================================
File: Represents the files or directories on the disk
I/O:JVM data exchange with external data sources. FILE,DB-IN-ÀJVM---out-àfile,db
There are three categories of flows:
Direction: input stream and output stream;
Unit: Byte stream and character stream;
byte stream:
Parent interface for Inputstream/outputstream Byte stream
(1) Fileinputstream/fileoutputstream file byte stream ((can be converted downward))
Datainputstream/dataoutputstream Read and write 8 basic types and read and write strings in UTF-8
Bufferedinputstream/bufferedoutputstream buffered input/output streams
PrintStream fused data and buffered, System.out belongs to the class
Piped pipeline for exchanging data between threads
Randomaccessfile Random Access files
stream of characters: Handling character encoding issues
Reader/writer the parent interface of a character stream
Filereader/filewriter file character stream, and Fileinputstream/fileoutputstream file stream,
(can be converted downward) is equal to (1) above,
Only one is a byte stream, the following is a character stream, so two can not be passed by legend
Inputstreamreader/outputstreamwriter Bridge Conversion converts bytes into character streams in the process of bridge conversion, you can make a codec
Bufferedreader/printwriter with Buffer
When a character stream is converted to a byte stream, the specified codec is specified when the bridge is converted.
Function points: node flow and filter flow;
Node stream: Used to transfer data.
Filter Flow: Helps the node stream to better transmit data.
Piped (Pipeline node Flow): Used to transfer data between two threads. The output of one thread, which is the input of another thread.
Serialization of objects:
Put objects on the stream to transmit Objectinputstream/objectoutputstream
Only objects that implement the serializable interface can be serialized
Properties that are decorated with transient, are temporary properties, do not participate in serialization, and can only be decorated with properties of the object.
The classification and application of IO stream in Java