Tuesday 15 May 2012

java - Is a PrintWriter a BufferedWriter -


Actually I would like to know whether PrintWriter is a buffer author or not. I have seen the code as PrintWriter pw = new PrintWriter (new buffer viter); however:

parameter: file - file to use If the file exists as the author's destination, it will be reduced to zero size; Otherwise, a new file will be created. The output will be written in the file and buffer will be done. < P> Bottom line: I think printwire is called "buffer" from Javadock (root See Ran) and if I can not touch the don print, it is not printed. Do you confirm my thesis? Why there is some code in that situation: PrintWriter pw = new PrintWriter (new buffer vetter (new flumerwriter (file)); legacy code?

Thanks in advance

Technically, this is not a BufferedWriter . It spreads directly to author . It is said, it seems Person can be is Based on a BufferedWriter constructor to use . A string :

  monitors the constructor passing through the public PrintWriter (string filename) for the tester throws FileNotFoundException {This (New BufferedWriter (New OutputStream Water ( New FileOutputStream (fileName))), false); }   

Besides, you are not using Constructor for Jawadock, which you have linked. You have used Constructor which takes a Writer does not use a BufferedWriter . This is its source code:

  / ** * Automatically creates a new PrintWriter without flushing the line. * * The ultimate out-of-a-character-output stream * / public printer (writer out) {This (out, falls); } / ** * creates a new PrintWriter * * @Onimal Out-of-a-character output stream * @ Ultimate Auto Flush A Boolean; If true, then & lt; Tt & gt; Println & lt; / Tt>, * & lt; Tt & gt; Printf & lt; / Tt>, or & lt; Tt & gt; Format & lt; / Tt & gt; Methods * Will Flush Output Buffer * / Public PrintWriter (Author Out, Boolean Auto Flush) {Super (Outside); This.out = out; This.autoFlush = autoFlush; Line separator = java Security Access Control Accepted (New Sun. Security Action. GetProperty Action ("Line Separator")); }    

No comments:

Post a Comment