Java-preliminary understanding of-i/o flow (character stream-buffer-bufferedreader-readline method principle)

Source: Internet
Author: User

One.

If the buffer is an array, as previously said, then writing bufr.read (BUF) cannot be understood. This sentence can only be seen as BUFR this buffer object, using the Read method, read the data into the BUF, not the buffer object BUFR read BUF array.

The buffer object has its own concrete method, rather than inheriting the parent class's read-reading method of a single character, depending on the principle.

The ReadLine method is more optimized than the method of the read single character, which is unique to the buffer object itself. Previously, the data in the hard disk was read into the buffer array of memory, and now it is qualified to operate one line at a time.

For continuous reading of a single character, and then in the form of a string output, can be used StringBuilder or stringbuffer to operate. StringBuilder the bottom layer is an array, and is variable length and returns a string.

Java-preliminary understanding of-i/o flow (character stream-buffer-bufferedreader-readline method principle)

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.