Public static void main (string [] ARGs) throws exception {<br/> // solve Chinese garbled characters <br/> // read a line from the IO stream <br/> inputstreamreader ISR = new inputstreamreader (New fileinputstream ("C: /Windows/windowsupdate. log ")," UTF-8 "); <br/> bufferedreader READ = new bufferedreader (ISR); <br/> while (read. ready () {<br/> system. out. println (read. readline ()); <br/>}< br/> // write a row to the IO stream <br/> // input true to append the content of the original file <br/> outputstreamwriter OSW = new outputstreamwriter (New fileoutputstream ("E: test.txt ", true)," gb2312 "); <br/> bufferedwriter BW = new bufferedwriter (OSW); <br/> for (INT I = 0; I <10; I ++) {<br/> BW. write (new date (). tolocalestring () + "[I =" + I + "]"); <br/> BW. newline (); <br/>}< br/> BW. flush (); <br/> BW. close (); <br/> OSW. close (); <br/>}