Summary of Java I/o---

Source: Internet
Author: User

The rule summary of IO Flow: The problem to be solved is the problem of which stream object should be used in the development.

1, clear data sources, data sinks (data purposes)

In fact, it is in the explicit IO system to be used: Byte stream InputStream & OutputStream, character stream Reader & Writer
The requirement is the source of action: it means reading, InputStream & Reader

Purpose of operation in demand: meant to be written, OutputStream & writer

2, is it clear that the manipulated data is plain text?

Yes, select the character stream object.
No, select the byte stream object.
Yes and is the source. Reader object and sub-class
Is and is also the purpose, writer object and sub-class

The first two clear, clear the specific to use the system.

The next step should be to identify which object to use in the specific system.

3, clear the specific equipment to operate. Each device has a corresponding stream object.

Source Device:
Hard disk, the stream object that can manipulate file is. File begins.
Keyboard, system.in;
Memory, Array.
Network, Socket stream.

Purpose Equipment:
Hard disk, the stream object that can manipulate file is. File begins.
Display, System.out
Memory, Array.
Internet. The socket stream.

A specific flow object can be found in the third step.

4. Do you need extra functionality?

Do you need to be efficient? Buffer, beginning with buffered.
Do you need an encoding conversion? Convert the stream.

2017-12-30 content to autobiographical intelligence podcast 

Summary of Java I/o---

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.