Stream classification commonly used in Java input/output stream systems (table content from http://www.cnblogs.com/moonpool/p/5488463.html)
Note: Abstract classes are underlined in the following table, and objects cannot be created. The bold part is the node stream, and the other is the usual processing stream.
| Stream classification |
Use classification |
BYTE input stream |
BYTE output stream |
Character input stream |
Character output stream |
|
Abstract base class |
InputStream |
OutputStream |
Reader |
Writer |
| Node stream |
accessing files |
FileInputStream |
Fileoutstream |
FileReader |
FileWriter |
| accessing values |
Bytearrayinputstream |
Bytearrayoutstream |
CharArrayReader |
Chararraywriter |
| Access pipeline |
PipedInputStream |
Pipedoutstream |
Pipedreader |
PipedWriter |
| accessing strings |
|
|
StringReader |
StringWriter |
| Process Flow |
Buffered streams |
Bufferedinputstream |
Bufferedoutputstream |
BufferedReader |
BufferedWriter |
| Convert stream |
|
|
InputStreamReader |
OutputStreamWriter |
| Object Flow |
ObjectInputStream |
ObjectOutputStream |
|
|
| Abstract base class (filter) |
FilterInputStream |
Filteroutputstream |
FilterReader |
Filterwriter |
| Print Flow |
|
PrintStream |
|
PrintWriter |
| Pushing back the input stream |
Pushbackinputstream |
|
Pushbackreader |
|
| Special flow |
DataInputStream |
DataOutputStream |
|
|
——————————————————————————————————————————————————————————————————
Summarize:
1.Java io is a decorative mode, that is, the process flow to wrap the flow of nodes to achieve code commonality.
2. Process flow and node flow differentiation method, node flow in the new need a data source (file, network) as a parameter, and the processing flow requires a node stream as a parameter.
3. The role of the processing stream is to improve the code commonality, write code convenience, improve performance.
4. node Flow is the implementation class corresponding to the abstract base class, both of which implement the basic reading and writing methods of the abstract base class. where the Read () method returns 1, the representation has been read to the end of the data source.
Stream classification commonly used in Java IO stream architecture