IO stream for Java 1.1

Source: Internet
Author: User

At this point, you may be caught in a dilemma, wondering if there is another design for IO flow and may require a greater amount of code. Can anyone suggest a more bizarre design? In fact, Java 1.1 has made some significant improvements to the IO stream library. When you see reader and writer classes, most people's first impression (as I do) is that they are used to replace the original InputStream and OutputStream classes. But the truth is not so. Although some features of the original data stream library are not recommended (such as using them, a warning message is received from the compiler), the original data stream is retained to maintain backward compatibility and:
(1) New classes are added to the old hierarchy, so sun is clearly not abandoning the old data stream.
(2) In many cases, we need to use classes in the old structure in conjunction with the classes in the new structure. To achieve this, you need to use some "bridge" classes: InputStreamReader converts a inputstream into a reader,outputstreamwriter converts a outputstream to writer.
Therefore, compared with the original IO stream library, the new IO stream is often more layered. Likewise, this is a disadvantage of the adorner scheme-the need to pay for additional flexibility.
The most important reason for adding reader and writer levels to Java 1.1 is the need for internationalization. The old IO flow hierarchy supports only 8-bit byte streams and does not control 16-bit Unicode characters well. Because Unicode is primarily oriented towards internationalization support (Java-contained char is 16-bit Unicode), the reader and writer levels are added to provide support for Unicode in all IO operations. In addition, the new library is optimized for speed, which runs faster than the old library.
As elsewhere in this book, I will try to provide an overview of the class, but assume that you'll use the online documentation to get all the details, such as a detailed list of methods.

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.