Java Io inputstream Reader

Source: Internet
Author: User

There are 2 types of Io stream

1. byte streams that are subclasses of inputstream or outputstream
2. Character streams that are subclasses of reader and writer

 

Inputstream/outputstream and Reader/writer are abstract class

 

Their class hierarchy is show:

 

 

 

-- Constructor functions --
Fileinputstream (File file)
Fileinputstream (filedescriptor fdobj)
Fileinputstream (string name)

 

Fileinputstream is meant for reading streams of raw bytes such as image data. For reading streams of characters, consider using filereader.

 

-- Constructor functions --

Bufferedinputstream (inputstream in)
Bufferedinputstream (inputstream in, int size)

-- Constructor functions --
Bufferedreader (Reader in)
Bufferedreader (Reader in, int sz)

 

-- Constructor functions --

Inputstreamreader (inputstream in)
Inputstreamreader (inputstream in, charset CS)
Inputstreamreader (inputstream in, charsetdecoder dec)
Inputstreamreader (inputstream in, string charsetname)

 

 

An inputstreamreader is a bridge from byte streams to character streams: It reads bytes and decodes them into characters using a specified charset. the charset that it uses may be specified by name or may be given explicitly, or the platform's default charset
May be accepted.

 

-- Constructor functions --

Filereader (File file)
Filereader (filedescriptor FD)
Filereader (string filename)

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.