BufferedOutputStreamNameBufferedOutputStreamSynopsis
DescriptionA BufferedOutputStream object provides a more efficient way to write just a few bytes at a time to an OutputStream. BufferedOutputStream objects use a buffer to store output for an associated OutputStream. In other words, a large number of bytes are stored in an internal buffer and only written when the buffer fills up or is explicitly flushed. A BufferedOutputStream is more efficient than a regular OutputStream because the data is written to memory, rather than a disk or a network. Minimizing the number of write operations to a disk or the network minimizes the cumulative overhead for these operations. You should wrap a BufferedOutputStream around any OutputStream whose write() operations may be time consuming or costly, such as a FileOutputStream. Class Summary
public class java.io.BufferedOutputStream extends java.io.FilterOutputStream { // Variables protected byte[] buf; protected int count; // Constructors public BufferedOutputStream(OutputStream out); public BufferedOutputStream(OutputStream out, int size); // Instance Methods public synchronized void flush(); public synchronized void write(int b); public synchronized void write(byte[] b, int off, int len); } Variablesbufprotected byte[] buf
countprotected int count
ConstructorsBufferedOutputStreampublic BufferedOutputStream(OutputStream out)
public BufferedOutputStream(OutputStream out, int size)
Instance Methodsflushpublic synchronized void flush() throws IOException
writepublic synchronized void write(int b) throws IOException
public synchronized void write(byte b[], int off, int len) throws IOException
Inherited Methods
See AlsoFilterOutputStream, IOException, OutputStream |
|