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