16-bit operation flow, encoding, 8/16 conversion, accuracy loss, zipfile

Source: Internet
Author: User
Tags wrapper zip

The family system of the 16-bit operation flow is this: Reader,writer abstract class,


Then the implementation class Filereader,filewriter, write can write the string content directly, read or the same.


Then is the base class wrapper class Bufferedreader,bufferwriter, which buffers the stream. The ReadLine can be used to read a line of lines, which can recognize line breaks. Then is the character array of the wrapper stream CharArrayReader, with the output content intercepting the stream chararraywriter,


Then is the eight-bit flow 16-bit stream operation class Inputreader, pay attention to the code, accidentally changed the code randomly garbled.


The following screenshot from Csdn's one senior's repost: Bowen Address: http://blog.csdn.net/u010737354/article/details/52456570,



With FileOutputStream as the representative, Writ wrote the int over ~128~127| | 0~255, it will be the basic data type coercion, all the way to byte eight-bit write down, the accuracy of the reference Windoss Programmer calculator calculation. No reference please leave a message, I will open a blog to talk about.


Take FileInputStream as the representative, writ's reading, is not more than 255, big is to make negative, this I also really can't push out, oh, right, pay attention to different encoding format, such as a Chinese character, read up the number of bytes may be 2, may be 3 bytes. Read reads a bit, the bits that are read are displayed in decimal, and can be converted to characters for easy viewing.


16-bit stream eight-bit streams, outputstreamwriter, base class like Filewrit, these are not capable of eight-bit and 16-bit direct conversions because of parameters. Eight-bit to 16-bit, 16-bit can read the eight-bit file path, 16 bits to eight bits, 16 bits can be written out for the eight-bit file path.


ZipFile: Used to read a file from a zip archive, the ZipEntry class is used to receive a ZIP file that zipfile reads. When the zip file is read, each file is wrapped in order to zipentry the object. The ZipFile getInputStream converts the zipentry to the output stream.

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.