Operational rules of IO flow in the Java language Learning notes

Source: Internet
Author: User

1 , clear source and purpose.

Data source: Is required to read, you can use two systems: InputStream, reader;

Data sinks: is required to write, you can use two systems: OutputStream, Writer;

Summarize:

READ: Just read the data into memory

Write: Just read the data.

2 , is the data of the operation plain text?

If it is: Data source: Reader

Data exchange: Writer

If not: Data source: InputStream

Data exchange: OutputStream

Summary: Text-only things with a byte stream, other with the word stream

3 , although a system has been identified, but there are too many objects in the system, which one to use?

Data devices that are explicitly operational.

Data source corresponding device: Hard disk (File), memory (array), keyboard (system.in)

Data sinks correspond to the device: Hard disk (File), memory (array), console (System.out).

4 , do you need to attach additional functionality to the basic operation? like Buffering.

Decorate if you need to.

Operational rules of IO flow in the Java language Learning notes

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.