Introduction of common concepts
Java IO, the basis of input and output, can easily realize the input and output of data
Ii. Classification of Streams
1. According to the direction of flow:
a). Input stream: Output to Application
b). Output stream: Output from the application
The input and output stream is in the perspective of the program, as long as the input to the program is the input stream, from the program output data is the output stream.
2. According to the data unit of the stream:
a). Byte stream: The transmission unit of the data is one bytes, 8 bits
b). Character Stream: Data transmission Unit is one character, 16 bits
3. Sort by the role of the stream
A). Node stream: A stream that reads and writes to a specific device, and the stream is linked to two actual data sources.
b). Process flow: Encapsulates an existing stream without connecting two centuries of data, extending the functionality of the original stream by encapsulating it.
Iii. List of flows
| 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 |
|
|
Java Javaio (i), basic knowledge