KickJava   Java API By Example, From Geeks To Geeks.

Java > Java SE, EE, ME > java > io > BufferedOutputStream

java.io
Class BufferedOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by java.io.BufferedOutputStream
All Implemented Interfaces:
Closeable, Flushable
See Also:
Top Examples, Source Code

protected byte[] buf
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BufferedOutputStream(OutputStream out)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public BufferedOutputStream(OutputStream out,
                            int size)
See Also:
IllegalArgumentException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


protected int count
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void flush()
           throws IOException
See Also:
FilterOutputStream.out, Flushable
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void write(byte[] b,
                  int off,
                  int len)
           throws IOException
See Also:
FilterOutputStream.write(int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[1348]Make a buffered tranfer from source to destination
By shamaz on 2005/03/15 11:34:55  Rate
/** 
      * Make a buffered tranfer from source to destination. 
      * Don't forget to close your streams after this method! 
      * 512 seems to be a good value for bufferSize 
      */
 
     public static void transfer (  InputStream source, OutputStream destination, int bufferSize  )  throws IOException 
      {  
         BufferedOutputStream ost = new BufferedOutputStream ( destination, bufferSize ) ; 
         byte [  ]  buffer = new byte [ bufferSize ] ; 
         int nBytes; 
  
  
         while (   ( nBytes = source.read ( buffer )  )  != -1  )  
          {  
             ost.write ( buffer, 0, nBytes ) ; 
          }  
         ost.close (  ) ; 
      } 


public void write(int b)
           throws IOException
See Also:
FilterOutputStream
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  

Popular Tags