Mobile development BufferedReader/BufferedWriter parsing,
FileWriter/FileReader
The file byte stream is connected to the encoding conversion stream"
FileWriter out = new FileWriter (File );
Equivalent
OutputStreamWriter out = new OutputStreamWriter (new FileOutputStream (File ))
Cannot be converted to the specified Encoding
BufferedReader/BufferedWriter
Byte Buffer
Create object
BufferedWriter out = new BufferedWriter (connected to the bytes Stream)
Method
BufferedReader
ReadLine ()
Read a line of string, excluding the end line break
Return null after reading
Chestnuts
Public static void main (String [] args) throws Exception {// The character stream that is connected to each other. encode and convert all the characters to be read. // you only need to use the character stream, the conversion stream BufferedReader in = new BufferedReader (new InputStreamReader (new FileInputStream ("d:/abc/f7"); String line; while (line = in. readLine ())! = Null) {System. out. println (line) ;}in. close ();}
Output result
Abc Chinese