Javase Advanced Section 17th write buffer class BufferedWriter

Source: Internet
Author: User

2016-07-24

1,bufferedwriter

Debug

F5 Entry Method

F6 executes the next line of code

F7 Exit method

F8 jumps to the next breakpoint

 Packagecom.java1995;ImportJava.io.BufferedReader;ImportJava.io.BufferedWriter;Importjava.io.FileNotFoundException;ImportJava.io.FileReader;ImportJava.io.FileWriter;Importjava.io.IOException; Public classCopyFile { Public Static voidMain (string[] args) {//shortcut keys for importing packages Ctrl+shift+oFileReader FR =NULL; FileWriter FW=NULL; BufferedReader BR=NULL; BufferedWriter BW=NULL; Try{FR=NewFileReader ("C:\\java1995\\workspace_se_2\\day17\\src\\com\\java1995\\copyfile.java"); FW=NewFileWriter ("C:\\java1995\\workspace_se_2\\day17\\src\\out.txt"); BR=NewBufferedReader (FR); Bw=NewBufferedWriter (FW); intc = 0;  while((c = Br.read ())! = 1) {bw.write (c); //Bw.flush ();} bw.flush (); } Catch(FileNotFoundException e) {//TODO auto-generated Catch blockE.printstacktrace (); } Catch(IOException e) {//TODO auto-generated Catch blockE.printstacktrace (); } finally {            Try{fr.close ();                Fw.close ();                Br.close ();            Bw.close (); } Catch(IOException e) {//TODO auto-generated Catch blockE.printstacktrace (); }        }    }}

Resources

[1] Java Easy Start Classic tutorial "full version"

Javase Advanced Section 17th write buffer class BufferedWriter

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.