After nth study Javaio

Source: Internet
Author: User

Io by flow points

Input stream, output stream

Io by type (is the type of bar)

Byte stream, character stream

-------------------------------------

Let's start with the confusion about when to use the input stream and when to use the output stream. The first input stream as the name implies is the input to what, here to stand in the program angle, input into the program, take (. txt) file content to print to the console, here is the .txt--> program, with the InputStream. Output is also relative to the program, need to write information to (. txt), is from the program-->.txt, with the outputstream.

Public abstract class InputStream extends Object implements Closeable

InputStream this abstract class is a superclass of all classes that represent byte input streams, which are primarily used to read bytes, have read (), and so on. The corresponding is OutputStream, there is write () and other methods.

  

Public abstract class Reader extends Object implements readable, closeable

Reader and writer Here are also a pair, and Inputstream/outputstream counterpart, reader and writer is to deal with the character stream. Garbled is starting from here! Because the characters have different encoding, there is UTF-8 storage, with GBK way read out garbled.

The most I want to do after learning Io is to read the files stored on the computer into the program to use, save data to local. With this knowledge you can make a MO system!

After nth study Javaio

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.