| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final ByteBuffer | |
| private final BufferPool | |
| private boolean | |
| private final Checksum | |
| public static final int | DEFAULT_BLOCK_SIZE
The default block size to use. |
| public static final double | DEFAULT_MIN_COMPRESSION_RATIO
The default min compression ratio to use. |
| private final ByteBuffer | |
| private final ByteBuffer | |
| public static final int | MAX_BLOCK_SIZE
The x-snappy-framed specification allows for a chunk size up to 16,777,211 bytes in length. |
| private final double | |
| private final WritableByteChannel | |
| private final ByteBuffer |
| Access | Constructor and Description |
|---|---|
| public | SnappyFramedOutputStream(OutputStream
The underlying out)OutputStream to write to. Must not be
null.Creates a new |
| public | SnappyFramedOutputStream(OutputStream
The underlying out, BufferPool OutputStream to write to. Must not be
null.Used to obtain buffer instances. Must not be bufferPool)null.Creates a new |
| public | SnappyFramedOutputStream(OutputStream
The underlying out, int OutputStream to write to. Must not be
null.The block size (of raw data) to compress before writing frames
to out. Must be in (0, 65536]. blockSize, double Defines the minimum compression ratio (
minCompressionRatio)compressedLength / rawLength) that must be achieved to
write the compressed data. This must be in (0, 1.0].Creates a new |
| public | SnappyFramedOutputStream(OutputStream
The underlying out, int OutputStream to write to. Must not be
null.The block size (of raw data) to compress before writing frames
to out. Must be in (0, 65536]. blockSize, double Defines the minimum compression ratio (
minCompressionRatio, BufferPool compressedLength / rawLength) that must be achieved to
write the compressed data. This must be in (0, 1.0].Used to obtain buffer instances. Must not be bufferPool)null.Creates a new |
| public | SnappyFramedOutputStream(WritableByteChannel
The underlying out)WritableByteChannel to write to. Must
not be null.Creates a new |
| public | SnappyFramedOutputStream(WritableByteChannel
The underlying out, BufferPool WritableByteChannel to write to. Must
not be null.Used to obtain buffer instances. Must not be bufferPool)null.Creates a new |
| public | SnappyFramedOutputStream(WritableByteChannel
The underlying out, int WritableByteChannel to write to. Must
not be null.The block size (of raw data) to compress before writing frames
to out. Must be in (0, 65536]. blockSize, double Defines the minimum compression ratio (
minCompressionRatio)compressedLength / rawLength) that must be achieved to
write the compressed data. This must be in (0, 1.0].Creates a new |
| public | SnappyFramedOutputStream(WritableByteChannel
The underlying out, int WritableByteChannel to write to. Must
not be null.The block size (of raw data) to compress before writing frames
to out. Must be in (0, 65536]. blockSize, double Defines the minimum compression ratio (
minCompressionRatio, BufferPool compressedLength / rawLength) that must be achieved to
write the compressed data. This must be in (0, 1.0].Used to obtain buffer instances. Must not be bufferPool)null.Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| public final void | close()
Overrides java. Implements java. Closes this channel. |
| public final void | flush()
Overrides java. Implements java. Flushes this output stream and forces any buffered output bytes to be written out. |
| private void | |
| public boolean | |
| public long | Returns: The number of bytes read from is.The source of data to compress. is)Transfers all the content from is to this |
| public long | Returns: The number of bytes read from rbc.The source of data to compress. rbc)Transfers all the content from rbc to this
|
| public void | write(int
the b)byte.Implements abstract java. Writes the specified byte to this output stream. |
| public void | write(byte[]
the data. input, int the start offset in the data. offset, int the number of bytes to write. length)Overrides java. Writes |
| public int | write(ByteBuffer
The buffer from which bytes are to be retrieved src)Implements java. Writes a sequence of bytes to this channel from the given buffer. |
| private void | writeBlock(final WritableByteChannel
The out, ByteBuffer OutputStream to write to.The data to write. data, boolean Indicates if data is the compressed or raw content.
This is based on whether the compression ratio desired is
reached. compressed, int The calculated checksum. crc32c)Write a frame (block) to out. |
| private void | writeCompressed(ByteBuffer buffer)
|
| private void | writeHeader(WritableByteChannel
The underlying out)OutputStream.Writes the implementation specific header or "marker bytes" to out. |
| blockSize | back to summary |
|---|---|
| private final int blockSize | |
| buffer | back to summary |
|---|---|
| private final ByteBuffer buffer | |
| bufferPool | back to summary |
|---|---|
| private final BufferPool bufferPool | |
| closed | back to summary |
|---|---|
| private boolean closed | |
| crc32 | back to summary |
|---|---|
| private final Checksum crc32 | |
| DEFAULT_BLOCK_SIZE | back to summary |
|---|---|
| public static final int DEFAULT_BLOCK_SIZE The default block size to use. | |
| DEFAULT_MIN_COMPRESSION_RATIO | back to summary |
|---|---|
| public static final double DEFAULT_MIN_COMPRESSION_RATIO The default min compression ratio to use. | |
| directInputBuffer | back to summary |
|---|---|
| private final ByteBuffer directInputBuffer | |
| headerBuffer | back to summary |
|---|---|
| private final ByteBuffer headerBuffer | |
| MAX_BLOCK_SIZE | back to summary |
|---|---|
| public static final int MAX_BLOCK_SIZE The x-snappy-framed specification allows for a chunk size up to 16,777,211 bytes in length. However, it also goes on to state:
| |
| minCompressionRatio | back to summary |
|---|---|
| private final double minCompressionRatio | |
| out | back to summary |
|---|---|
| private final WritableByteChannel out | |
| outputBuffer | back to summary |
|---|---|
| private final ByteBuffer outputBuffer | |
| SnappyFramedOutputStream | back to summary |
|---|---|
| public SnappyFramedOutputStream(OutputStream out) throws IOException Creates a new
Uses
| |
| SnappyFramedOutputStream | back to summary |
|---|---|
| public SnappyFramedOutputStream(OutputStream out, BufferPool bufferPool) throws IOException Creates a new
| |
| SnappyFramedOutputStream | back to summary |
|---|---|
| public SnappyFramedOutputStream(OutputStream out, int blockSize, double minCompressionRatio) throws IOException Creates a new
Uses
| |
| SnappyFramedOutputStream | back to summary |
|---|---|
| public SnappyFramedOutputStream(OutputStream out, int blockSize, double minCompressionRatio, BufferPool bufferPool) throws IOException Creates a new
| |
| SnappyFramedOutputStream | back to summary |
|---|---|
| public SnappyFramedOutputStream(WritableByteChannel out) throws IOException Creates a new
Uses
| |
| SnappyFramedOutputStream | back to summary |
|---|---|
| public SnappyFramedOutputStream(WritableByteChannel out, BufferPool bufferPool) throws IOException Creates a new
Uses
| |
| SnappyFramedOutputStream | back to summary |
|---|---|
| public SnappyFramedOutputStream(WritableByteChannel out, int blockSize, double minCompressionRatio) throws IOException Creates a new
| |
| SnappyFramedOutputStream | back to summary |
|---|---|
| public SnappyFramedOutputStream(WritableByteChannel out, int blockSize, double minCompressionRatio, BufferPool bufferPool) throws IOException Creates a new
| |
| close | back to summary |
|---|---|
| public final void close() throws IOException Overrides java. Implements java. Doc from java. Closes this channel. After a channel is closed, any further attempt to invoke I/O
operations upon it will cause a If this channel is already closed then invoking this method has no effect. This method may be invoked at any time. If some other thread has already invoked it, however, then another invocation will block until the first invocation is complete, after which it will return without effect.
| |
| flush | back to summary |
|---|---|
| public final void flush() throws IOException Overrides java. Implements java. Doc from java. Flushes this output stream and forces any buffered output bytes
to be written out. The general contract of If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.
| |
| flushBuffer | back to summary |
|---|---|
| private void flushBuffer() throws IOException Compresses and writes out any buffered data. This does nothing if there is no currently buffered data. | |
| isOpen | back to summary |
|---|---|
| public boolean isOpen() Implements java. Doc from java. Tells whether or not this channel is open.
| |
| transferFrom | back to summary |
|---|---|
| public long transferFrom(InputStream is) throws IOException Transfers all the content from is to this
| |
| transferFrom | back to summary |
|---|---|
| public long transferFrom(ReadableByteChannel rbc) throws IOException Transfers all the content from rbc to this
| |
| write | back to summary |
|---|---|
| public void write(int b) throws IOException Implements abstract java. Doc from java. Writes the specified byte to this output stream. The general
contract for
| |
| write | back to summary |
|---|---|
| public void write(byte[] input, int offset, int length) throws IOException Overrides java. Doc from java. Writes
If
If
| |
| write | back to summary |
|---|---|
| public int write(ByteBuffer src) throws IOException Implements java. Doc from java. Writes a sequence of bytes to this channel from the given buffer. An attempt is made to write up to r bytes to the channel,
where r is the number of bytes remaining in the buffer, that is,
Suppose that a byte sequence of length n is written, where
Unless otherwise specified, a write operation will return only after writing all of the r requested bytes. Some types of channels, depending upon their state, may write only some of the bytes or possibly none at all. A socket channel in non-blocking mode, for example, cannot write any more bytes than are free in the socket's output buffer. This method may be invoked at any time. If another thread has already initiated a write operation upon this channel, however, then an invocation of this method will block until the first operation is complete.
| |
| writeBlock | back to summary |
|---|---|
| private void writeBlock(final WritableByteChannel out, ByteBuffer data, boolean compressed, int crc32c) throws IOException Write a frame (block) to out.
| |
| writeCompressed | back to summary |
|---|---|
| private void writeCompressed(ByteBuffer buffer) throws IOException
| |
| writeHeader | back to summary |
|---|---|
| private void writeHeader(WritableByteChannel out) throws IOException Writes the implementation specific header or "marker bytes" to out.
| |