IO stream part IO stream is commonly used: character stream, byte stream, buffered stream, serialized stream, Randomaccessfile class, etc. 1, byte stream
-
Fileinputstream/fileoutputstream
-
Bufferedinputstream/bufferedoutputstream
2. Character Stream
-
Inputstreamreader/outputstreamwriter
-
Bufferedreader/bufferedwriter
-
Filereader/filewriter
-
Where Bufferedreader/bufferedwriter is also known as the character buffer stream , you can read one line at a time, write one line at a time; filereader/filewriter Inputstreamreader/outputstreamwriter inherited from,Inputstreamreader/outputstreamwriter, BufferedReader/ BufferedWriter is inherited from reader/writer;
3. Buffer Stream (Buffer stream in bytes)
-
Bufferedinputstream/bufferedoutputstream
-
Buffered streams are byte-stream
4, Randomaccessfile class
-
The Randomaccessfile class is written in the literal sense of a random write, which means that there are two ways that the class can write and write;
5, the object's deserialization stream, the serialized stream (ObjectOutputStream, ObjectInputStream)
-
Serializing the stream, deserializing the stream involves the serialization interface (serializable), and wants to implement the serialization and deserialization of the object, which must inherit the serialized interface (that is, implements serializable)
-
Note : All streams need to perform a close stream operation (that is, the close () method) after completion of the operation, while the input stream is refreshed (that is, the flush () method) operation;
Java IO stream part knowledge point