BufferedWriter


BufferedWriter java.io

Java 1.1 appendable closeable flushable

This class applies buffering to a character output stream, improving output efficiency by coalescing many small write requests into a single larger request. You create a BufferedWriter by specifying some other character output stream to which it sends its buffered and coalesced output. (You can also specify a buffer size at this time, although the default size is usually satisfactory.) Typically, you use this sort of buffering with a FileWriter or OutputStreamWriter . BufferedWriter defines the standard write( ) , flush( ) , and close( ) methods all output streams define, but it adds a newLine( ) method that outputs the platform-dependent line separator (usually a newline character, a carriage -return character, or both) to the stream. BufferedWriter is the character-stream analog of BufferedOutputStream .

Figure 9-4. java.io.BufferedWriter

 public class  BufferedWriter  extends Writer {  // Public Constructors  public  BufferedWriter  (Writer  out  );        public  BufferedWriter  (Writer  out  , int  sz  );  // Public Instance Methods  public void  newLine  ( ) throws IOException;  // Public Methods Overriding Writer  public void  close  ( ) throws IOException;        public void  flush  ( ) throws IOException;        public void  write  (int  c  ) throws IOException;        public void  write  (char[ ]  cbuf  , int  off  , int  len  ) throws IOException;        public void  write  (String  s  , int  off  , int  len  ) throws IOException;   } 



Java In A Nutshell
Java In A Nutshell, 5th Edition
ISBN: 0596007736
EAN: 2147483647
Year: 2004
Pages: 1220

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net