java IO streams in what?

  • According to the data flow: the input and output streams

Inputs and outputs are from the perspective of the program is.

Input stream: data flow program

Output stream: data flows from the program.
    

  • By the processing unit: byte stream and character stream

Byte stream: one is read into or read 8-bit binary

Character stream: once read in or out is a 16-bit binary

JDK is a suffix byte Stream stream; suffix Reader, Writer character stream

 

  • Function Function: node flow and processing flow

Node Stream: source connected directly to the data, read or write

Process streams: one stream using the node, the node based on the stream, and then a layer of sheathing

 

The most fundamental of four categories: InputStream (input stream of bytes), OutputStream (output stream of bytes), Reader (character input stream), Writer (character output stream)

Extended four categories, according to the processing unit to distinguish

  1. InputStream:FileInputStream、PipedInputStream、ByteArrayInputStream、BufferedInputstream、SequenceInputStream、DataInputStream、ObjectInputStream
  2. OutputStream:FileOutputStream、PipedOutputStream、ByteArrayOutputStream、BufferedOutputStream、DataOutputStream、ObjectOutputStream、PrintStream
  3. Reader:FileReader、PipedReader、CharArrayReader、BufferedReader、InputStreamReader
  4. Writer:FileWriter、PipedWriter、CharArrayWriter、BufferedWriter、InputStreamWriter、PrintWriter

 

Commonly used flow

  1. The file operations: FileInputStream (input stream of bytes), FileOutputStream (output stream of bytes), FileReader (character input stream), FileWriter (character output stream)
  2. The pipeline operation: PipedInputStream (input stream of bytes), PipedOutStream (output stream of bytes), PipedReader (character input stream), PipedWriter (character output stream)
  3. Byte / character array: ByteArrayInputStream, ByteArrayOutputStream, CharArrayReader, CharArrayWriter
  4. Buffered 缓冲流:BufferedInputStream、BufferedOutputStream、BufferedReader、BufferedWriter
  5. Converted to byte character stream: InputStreamReader, OutputStreamWriter
  6. Stream: DataInputStream, DataOutputStream
  7. Print streams: PrintStream, PrintWriter
  8. Object flow: ObjectInputStream, ObjectOutputStream
  9. Serialization stream: SequenceInputStream


 


 

All resources resources are summarized in the public No.


 

 

Guess you like

Origin www.cnblogs.com/ConstXiong/p/11921573.html