1. Buffered input File
2. Input from memory
3. Formatted memory input
4. Basic Text Output
Example:
public class Brandbworpwdemo {public static void Main (string[] args) throws ioexception{ //Read and write to file BufferedReader br = new BufferedReader (new InputStreamReader ( new FileInputStream ("E:\\javaio\\imooc.txt")) ); /*bufferedwriter bw = new BufferedWriter (new outputstreamwriter ( new FileOutputStream ("e:\\javaio\\ Imooc3.txt "))); * *
PrintWriter pw = new PrintWriter ("E:\\javaio\\imooc4.txt");// //printwriter PW1 = new PrintWriter (OutputStream, Boolean autoflush); String Line; while (lines = Br.readline ())!=null) { System.out.println (line);//read one row at a time, and do not recognize the newline /*bw.write (line); Write the line-break operation separately bw.newline ();//newline Operation Bw.flush (); */ Pw.println (line) ; Pw.flush (); } Br.close (); Bw.close (); Pw.close (); }}
Java Learning Note IO One ()