J2se basics: 12. Io stream Programming

Source: Internet
Author: User

Tag: Io

Inheritance System:


1: byte stream



All streams ending with streams are byte streams. Byte streams are used to read binary data.




2: Ghost stream

All ends with reader/writer.

Write
Append (char C): Write character
Write (char [] cbuf)
Write (string Str)
Write (int c)

Flush ()
Close ()

Filewrite (); used to operate files.

Bufferwriter ();


Stream with buffer
Newline (): enter a line break.



Reader



Filereader

Bufferreader
Readline ();




3: note the following when using word throttling and text streaming:


1: byte streams and byte streams are read by one byte or one character by default.

2: If a byte array or character array is used, remember to control the number of bytes or characters that are last read.

3: if low-level and advanced streams are used, close the advanced stream first, and then close the low-level stream.


Conversion between byte stream and byte stream


Inputstreamreader: converts a byte input stream to a character input stream.

Outputstreamwriter: converts byte output into character output streams.

Inputstremreader: belongs to the bytes stream.






How to Use stream to read configuration files


Configuration file:
Write the dynamically changed data in the program into the file, and the program dynamically obtains the content in the file.

This type of file is the configuration file.


INI:

Properties:

XML:

J2se basics: 12. Io stream Programming

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.