public class BufferingOutputStream
extends java.io.OutputStream
The stream zeroes out the internal buffer on each flush.
Constructor and Description |
---|
BufferingOutputStream(java.io.OutputStream other)
Create a buffering stream with the default buffer size (4096).
|
BufferingOutputStream(java.io.OutputStream other,
int bufferSize)
Create a buffering stream with a specified buffer size.
|
public BufferingOutputStream(java.io.OutputStream other)
other
- output stream to be wrapped.public BufferingOutputStream(java.io.OutputStream other, int bufferSize)
other
- output stream to be wrapped.bufferSize
- size in bytes for internal buffer.public void write(byte[] bytes, int offset, int len) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
- on error.public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException