Java IO Fundamentals (java.io)

Source: Internet
Author: User

First, the stream is divided into input and output streams, and Java is divided into byte stream and character stream

1. Byte input stream io. InputStream

   Io. InputStream is an abstract class that implements an abstract class of closeable interfaces. Then its subclass (IO package) has Bytearrayinputstream,fileinputstream,filterinputstream,pipedinputstream

Bytearrayinputstream is a byte array as a buffer.

FileInputStream is primarily used for files, see the file class to discover that a file object is more than just a document or a path.

The role of FilterInputStream is to "encapsulate other input streams and provide them with additional functionality". Its commonly used subclasses are Bufferedinputstream and DataInputStream. So here's the bufferedinputstream.

function is to provide buffering for the input stream, as well as the mark () and reset () functions.

      The PipedInputStream is primarily used for switching multiple pipelines in multiple threads.

2 . Byte output stream io. OutputStream Ibid .

3. Character input stream io. Reader

  4. Character output stream io. Writer

 

The answer is yes if the character and byte stream can be converted to each other.

Inputstreamreader&outputstreamwriter

Java IO Fundamentals (java.io)

Related Article

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.