I/O Input and Output

Source: Internet
Author: User

I/O Input and Output

Abstract int read () indicates reading one byte and then returning the read bytes. When the returned number is-1, the byte stream is read.

Int read (byte [] B) indicates to read data into a byte array and then return the actual number of bytes read. When the returned number is-1, the byte stream is read.

Int read (byte [] B, int off, int len) indicates the number of bytes read from a single byte array. When the returned number is-1, the byte stream is read. Off is the starting offset of the byte array. len indicates the maximum number of bytes read.

Why is the first method Abstract? Because the second method is implemented by the third method, and the third method is implemented by the first method.

Available () to obtain the number of bytes of the input stream.

Skip () is used to locate the input position pointer.

Reset (), returns the previous flag.

Mark (int a), mark bit. If the number of digits read exceeds a, continue reading.

3. outputStream

Abstract int write (int a) writes a byte to the input stream.

Int writer (byte [] B) writes a byte array to the input stream.

Int writer (byte [] B, int off, int len) writes an offset from off to the input stream and ends when the number is len.

 

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.