1: Character Stream (mastering)
(1) Byte stream operation Chinese data is not particularly convenient, so there is a conversion stream.
The function of the conversion stream is to use the byte stream to convert the character stream.
(2) The conversion stream is actually a character stream
Character stream = byte stream + encoding table
(3) Coding table
A: A table consisting of characters and corresponding values
B: Common Coding tables
Ascii
Iso-8859-1
GB2312
GBK
GB18030
UTF-8
C: Encoding issues in strings
Coding
String--byte[]
Decoding
Byte[]--string
(4) Coding problems in IO stream
A:outputstreamwriter
OutputStreamWriter (outputstream OS): Default encoding, GBK
OutputStreamWriter (OutputStream OS, String CharSet): Specifying encoding
B:inputstreamreader
InputStreamReader (InputStreamReader is): Default encoding, GBK
InputStreamReader (InputStreamReader is,string CharSet): Specify encoding
C: The coding problem is actually very simple
As long as the code is consistent
(5) Character stream
Reader
|--inputstreamreader
|--filerreader
|--bufferedreader
Writer
|--OutputStreamWriter
|--filewriter
|--bufferedwriter
(6) Copy the text file (5 ways)
2:io Flow Summary (master)
IO stream
|--Byte stream
|--byte input stream
InputStream
int read (): reads one byte at a time
int read (byte[] bys): reads one byte array at a time
|--fileinputstream
|--bufferedinputstream
|--byte output stream
OutputStream
void write (int by): Write one byte at a time
void Write (byte[] bys,int. index, int len): Write one part of a byte array at a time
|--fileoutputstream
|--bufferedoutputstream
|--character Stream
|--character input stream
Reader
int read (): read one character at a time
int read (char[] CHS) reads one character array at a time
|--inputstreamreader
|--filereader
1--bufferedreader
String ReadLine (); read one string at a time
|--character output stream
Writer
void write (int ch): Write one character at a time
void Write (Char[]cha, int index,int1en): writes one part of a character array at a time
|--outputstreamwriter
|--filewriter
|--bufferedwriter
void newline (): Write a line break
void write (string line): Write one string at a time
3: Case study (comprehension exercise once again)
A: Copy A text file 5 ways (Master)
B: Copy Picture (binary stream data) 4 ways (Master)
C: Store the data in the collection into a text file
D: Reading data from a text file into a set merge traversal collection
E: Copy single-level
F: Copy the file specified in the single-level folder and modify the name
Review the bulk modification name
G: Copy Multilevel folders
H: Keyboard entry Student information stored in a text file from high to low score
I: Sort the strings in a file and output them to another text file
J: Using reader to simulate the unique functions of BufferedReader
K: Unique features of analog LineNumberReader
First, Javase (21) character stream, Io flow summary, case