Java defines two types of streams: byte streams and byte streams. Byte streams provide methods for processing the input and output of bytes. For example, when reading and writing binary data, byte streams are used. The character stream provides a convenient way to process character input and output. They use Unicode encoding, so they can be internationalized. Another point: At the bottom layer, All I/O is still byte-oriented. Character-based stream only provides a convenient and efficient way to process characters.
Byte stream
Byte streams are defined by two levels of classes. There are two abstract classes at the top level: inputstream and outputstream. Each abstract class has several sub-classes that process different devices.
Stream type
|
Description
|
Bufferedinputstream
|
Cached input stream
|
Bufferedoutputstream
|
Cached output stream
|
Bytearrayinputstream
|
Input stream for reading byte array content
|
Bytearrayoutputstream
|
Output stream of content written to the byte array
|
Datainputstream
|
Input stream that contains methods for reading java standard data types
|
Dataoutputstream
|
Output stream that contains methods for reading java standard data types
|
Fileinputstream
|
Input stream for reading file content
|
Fileoutputstream
|
Output stream of content written to the file
|
Filterinputstream
|
Implement inputstream
|
Filteroutputstream
|
Implement outputstream
|
Inputstream
|
Abstract class that describes Stream Input
|
Objectinputstream
|
Input stream for objects
|
Objectoutputstream
|
Used for the output stream of an object
|
Outputstream
|
Abstract class describing stream output
|
Pipedinputstream
|
Input MPs queue
|
Pipedoutputstream
|
Output Pipeline
|
Printstream
|
Output stream containing print () and println ()
|
Pushbackinputstream
|
1-Byte "unget" input stream is supported. This type of flow to the input stream returns 1 byte
|
Sequenceinputstream
|
Input stream composed of two or more input streams read sequentially
|
Next, let's talk about byte stream and byte stream.