| java.lang.Object java.io.OutputStream org.archive.io.RecyclingFastBufferedOutputStream
RecyclingFastBufferedOutputStream | public class RecyclingFastBufferedOutputStream extends OutputStream (Code) | | Lightweight, unsynchronised, aligned output stream buffering class.
This class provides buffering for output streams, but it does so with
purposes and an internal logic that are radically different from the ones
adopted in
java.io.BufferedOutputStream .
All methods are unsychronised. Moreover,
it is guaranteed that all writes performed by this class will be
multiples of the given buffer size. If, for instance, you use the
default buffer size, writes will be performed on the underlying input stream
in multiples of 16384 bytes. This is very important on operating systems
that optimise disk reads on disk block boundaries.
|
Method Summary | |
public void | close() | public void | write(int b) | public void | write(byte b, int offset, int length) |
DEFAULT_BUFFER_SIZE | final public static int DEFAULT_BUFFER_SIZE(Code) | | The default size of the internal buffer in bytes (16Ki).
|
buffer | protected byte buffer(Code) | | The internal buffer.
|
pos | protected int pos(Code) | | The current position in the buffer.
|
RecyclingFastBufferedOutputStream | public RecyclingFastBufferedOutputStream(OutputStream os, byte[] buffer)(Code) | | Creates a new fast buffered output stream by wrapping a given output stream, using a given buffer
Parameters: os - an output stream to wrap. Parameters: buffer - buffer to use internally. |
RecyclingFastBufferedOutputStream | public RecyclingFastBufferedOutputStream(OutputStream os, int bufSize)(Code) | | Creates a new fast buffered output stream by wrapping a given output stream with a given buffer size.
Parameters: os - an output stream to wrap. Parameters: bufSize - the size in bytes of the internal buffer. |
|
|