The input data is blocked into 32kb size (in default), and each block is
compressed and then passed to the given OutputStream.
SnappyCodec (8 bytes)
Note that the compressed data created by SnappyOutputStream cannot be
uncompressed by Snappy#uncompress(byte[]) since the output formats of
Snappy#compress(byte[]) and SnappyOutputStream are different.
Use SnappyInputStream for uncompress the data generated by
SnappyOutputStream.
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private boolean | |
| pack-priv static final int | |
| private boolean | |
| protected byte[] | |
| private final BufferAllocator | |
| private int | |
| public static final int | |
| pack-priv static final int | |
| protected final OutputStream | |
| protected byte[] | |
| private final BufferAllocator | |
| private int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| protected void | |
| protected void | |
| public void | flush()
Overrides java. Implements java. Flushes this output stream and forces any buffered output bytes to be written out. |
| private boolean | |
| public void | |
| pack-priv static int | |
| public void | write(byte[]
the data. b, int the start offset in the data. byteOffset, int the number of bytes to write. byteLength)Overrides java. Writes |
| public void | write(long[]
input array d, int offset in the array off, int the number of elements in the array to copy len)Compress the input long array data |
| public void | write(double[]
input array f, int offset in the array off, int the number of elements in the array to copy len)Compress the input double array data |
| public void | write(float[]
input array f, int offset in the array off, int the number of elements in the array to copy len)Compress the input float array data |
| public void | write(int[]
input array f, int offset in the array off, int the number of elements in the array to copy len)Compress the input int array data |
| public void | write(short[]
input array f, int offset in the array off, int the number of elements in the array to copy len)Compress the input short array data |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | write(int
the b)byte.Implements abstract java. Writes the specified byte to this output stream. |
| protected void | |
| protected void | |
| protected int | |
| pack-priv static void |
| blockSize | back to summary |
|---|---|
| private final int blockSize | |
| closed | back to summary |
|---|---|
| private boolean closed | |
| DEFAULT_BLOCK_SIZE | back to summary |
|---|---|
| pack-priv static final int DEFAULT_BLOCK_SIZE | |
| headerWritten | back to summary |
|---|---|
| private boolean headerWritten | |
| inputBuffer | back to summary |
|---|---|
| protected byte[] inputBuffer | |
| inputBufferAllocator | back to summary |
|---|---|
| private final BufferAllocator inputBufferAllocator | |
| inputCursor | back to summary |
|---|---|
| private int inputCursor | |
| MAX_BLOCK_SIZE | back to summary |
|---|---|
| public static final int MAX_BLOCK_SIZE | |
| MIN_BLOCK_SIZE | back to summary |
|---|---|
| pack-priv static final int MIN_BLOCK_SIZE | |
| out | back to summary |
|---|---|
| protected final OutputStream out | |
| outputBuffer | back to summary |
|---|---|
| protected byte[] outputBuffer | |
| outputBufferAllocator | back to summary |
|---|---|
| private final BufferAllocator outputBufferAllocator | |
| outputCursor | back to summary |
|---|---|
| private int outputCursor | |
| SnappyOutputStream | back to summary |
|---|---|
| public SnappyOutputStream(OutputStream out) | |
| SnappyOutputStream | back to summary |
|---|---|
public SnappyOutputStream(OutputStream out, int blockSize)
| |
| SnappyOutputStream | back to summary |
|---|---|
| public SnappyOutputStream(OutputStream out, int blockSize, BufferAllocatorFactory bufferAllocatorFactory) | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. close the stream
| |
| compressInput | back to summary |
|---|---|
| protected void compressInput() throws IOException | |
| dumpOutput | back to summary |
|---|---|
| protected void dumpOutput() throws IOException | |
| flush | back to summary |
|---|---|
| public 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.
| |
| hasSufficientOutputBufferFor | back to summary |
|---|---|
| private boolean hasSufficientOutputBufferFor(int inputSize) | |
| rawWrite | back to summary |
|---|---|
| public void rawWrite(Object array, int byteOffset, int byteLength) throws IOException Compress the raw byte array data.
| |
| readInt | back to summary |
|---|---|
| pack-priv static int readInt(byte[] buffer, int pos) | |
| write | back to summary |
|---|---|
| public void write(byte[] b, int byteOffset, int byteLength) throws IOException Overrides java. Doc from java. Writes
If
If
| |
| write | back to summary |
|---|---|
| public void write(long[] d, int off, int len) throws IOException Compress the input long array data
| |
| write | back to summary |
|---|---|
| public void write(double[] f, int off, int len) throws IOException Compress the input double array data
| |
| write | back to summary |
|---|---|
| public void write(float[] f, int off, int len) throws IOException Compress the input float array data
| |
| write | back to summary |
|---|---|
| public void write(int[] f, int off, int len) throws IOException Compress the input int array data
| |
| write | back to summary |
|---|---|
| public void write(short[] f, int off, int len) throws IOException Compress the input short array data
| |
| write | back to summary |
|---|---|
| public void write(long[] d) throws IOException Compress the input array data | |
| write | back to summary |
|---|---|
| public void write(double[] f) throws IOException Compress the input array data | |
| write | back to summary |
|---|---|
| public void write(float[] f) throws IOException Compress the input array data | |
| write | back to summary |
|---|---|
| public void write(int[] f) throws IOException Compress the input array data | |
| write | back to summary |
|---|---|
| public void write(short[] f) throws IOException Compress the input array data | |
| write | back to summary |
|---|---|
| public void write(int b) throws IOException Implements abstract java. Writes the specified byte to this output stream. The general contract for write is that one byte is written to the output stream. The byte to be written is the eight low-order bits of the argument b. The 24 high-order bits of b are ignored.
| |
| writeBlockPreemble | back to summary |
|---|---|
| protected void writeBlockPreemble() Optionally write a preemble before a block. Hadoop requires the actual block data size being written. This base
implementation does nothing. Derive implementation can call | |
| writeCurrentDataSize | back to summary |
|---|---|
| protected void writeCurrentDataSize() | |
| writeHeader | back to summary |
|---|---|
| protected int writeHeader() | |
| writeInt | back to summary |
|---|---|
| pack-priv static void writeInt(byte[] dst, int offset, int v) | |