Common ways to read and write Java IO

Source: Internet
Author: User

Java streams are divided into two major classes, byte stream and character stream. Generally in C + +, one byte is 8 bits, and Java is the same. However, a character, Char, is typically 8 bits in C/s + + (possibly different machines), but in Java to support Unicode encoding, char is 16 bits. As a result, Java also has a byte stream and a stream of words.

Typical representatives of them are:

1. Byte stream

InputStream and OutputStream

2. Character Stream

Reader and writer

I think the reader has to keep these two differences in mind, and the rest is just going to change from these two categories. Look at the JDK source code, you know how to use some methods.

Not finished, to be continued .....

  

Common ways to read and write Java IO

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.