"Java" Javaio (i), basic knowledge

Source: Internet
Author: User

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

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.