The concept of Java streaming

Source: Internet
Author: User

Classification of streams:

  

By flow: input stream, output stream

by Data unit:

  BYTE Stream (a read-in or read-out is a 8-bit binary, which is a single byte)

  

  Character Stream (one read or read out is a 16-bit binary, that is, one character)

  

By processing type:

  Node stream (directly connected to the data source, read in or read out)

  

  Processing flow (with a node stream, on the basis of the node flow, then a layer, the socket on the node stream is the processing flow)

  

To manipulate a file:

FileInputStream: Byte input stream

FileOutputStream: Byte output stream

FileReader: Character input stream

FileWriter: Character output stream

To operate a pipeline:

PipedInputStream, PipedOutputStream (primarily for threading operations)

Pipedreader, PipedWriter

BYTE/character array:

Bytearrayinputstream, Bytearrayoutputstream (a byte array is opened in memory)

CharArrayReader, Chararraywriter (opens a character array in memory)

Buffer buffered stream (avoids every direct read of the hard drive):

Bufferedinputstream, Bufferedoutputstream

BufferedReader, BufferedWriter

Conversion Flow: InputStreamReader, OutputStreamWriter

Data Flow: DataInputStream, DataOutputStream (data flow can directly output float type or long type, improve the efficiency of data read and write)

Print Flow:printstream,printwriter (typically printed to the console, where you can control the printing)

Object Flow: ObjectInputStream, ObjectOutputStream (direct output of the encapsulated object instead of converting it to a string and then outputting it)

serialized stream: Sequenceinputstream (Convert object directly to binary, write to media)

The concept of Java streaming

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.