This class compresses data into fixed-size blocks of compressed data.
LZ4BlockInputStream
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final byte[] | |
| private final Checksum | |
| private final byte[] | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| private final int | |
| private final LZ4Compressor | |
| pack-priv static final int | |
| private boolean | |
| pack-priv static final int | |
| pack-priv static final byte[] | |
| pack-priv static final int | |
| pack-priv static final int | |
| pack-priv static final int | |
| private int | |
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public | LZ4BlockOutputStream(OutputStream
the out, int OutputStream to feedthe maximum number of bytes to try to compress at once,
must be >= 64 and <= 32 M blockSize, LZ4Compressor the compressor, Checksum LZ4Compressor instance to use to compress
datathe checksum, boolean Checksum instance to use to check data for
integrity.true if pending data should also be flushed on syncFlush)flush()Create a new |
| public | LZ4BlockOutputStream(OutputStream out, int blockSize, LZ4Compressor compressor)
Create a new instance which checks stream integrity using
|
| public | LZ4BlockOutputStream(OutputStream out, int blockSize)
Create a new instance which compresses with the standard LZ4 compression algorithm. |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides java. Implements java. |
| private static int | |
| private void | |
| public void | |
| public void | flush()
Overrides java. Implements java. OutputStream.
|
| private void | |
| public String | |
| public void | write(int
the b)byte.Overrides java. byte to this output stream.
|
| public void | write(byte[]
the data. b, int the start offset in the data. off, int the number of bytes to write. len)Overrides java. len bytes from the specified
byte array starting at offset off to
this output stream.
|
| public void | write(byte[]
the data to be written. b)Overrides java. b.length bytes to this output stream.
|
| private static void |
| blockSize | back to summary |
|---|---|
| private final int blockSize | |
| buffer | back to summary |
|---|---|
| private final byte[] buffer | |
| checksum | back to summary |
|---|---|
| private final Checksum checksum | |
| compressedBuffer | back to summary |
|---|---|
| private final byte[] compressedBuffer | |
| COMPRESSION_LEVEL_BASE | back to summary |
|---|---|
| pack-priv static final int COMPRESSION_LEVEL_BASE | |
| COMPRESSION_METHOD_LZ4 | back to summary |
|---|---|
| pack-priv static final int COMPRESSION_METHOD_LZ4 | |
| COMPRESSION_METHOD_RAW | back to summary |
|---|---|
| pack-priv static final int COMPRESSION_METHOD_RAW | |
| compressionLevel | back to summary |
|---|---|
| private final int compressionLevel | |
| compressor | back to summary |
|---|---|
| private final LZ4Compressor compressor | |
| DEFAULT_SEED | back to summary |
|---|---|
| pack-priv static final int DEFAULT_SEED | |
| finished | back to summary |
|---|---|
| private boolean finished | |
| HEADER_LENGTH | back to summary |
|---|---|
| pack-priv static final int HEADER_LENGTH | |
| MAGIC | back to summary |
|---|---|
| pack-priv static final byte[] MAGIC | |
| MAGIC_LENGTH | back to summary |
|---|---|
| pack-priv static final int MAGIC_LENGTH | |
| MAX_BLOCK_SIZE | back to summary |
|---|---|
| pack-priv static final int MAX_BLOCK_SIZE | |
| MIN_BLOCK_SIZE | back to summary |
|---|---|
| pack-priv static final int MIN_BLOCK_SIZE | |
| o | back to summary |
|---|---|
| private int o | |
| syncFlush | back to summary |
|---|---|
| private final boolean syncFlush | |
| LZ4BlockOutputStream | back to summary |
|---|---|
| public LZ4BlockOutputStream(OutputStream out, int blockSize, LZ4Compressor compressor, Checksum checksum, boolean syncFlush) Create a new
| |
| LZ4BlockOutputStream | back to summary |
|---|---|
| public LZ4BlockOutputStream(OutputStream out, int blockSize, LZ4Compressor compressor) Create a new instance which checks stream integrity using
| |
| LZ4BlockOutputStream | back to summary |
|---|---|
| public LZ4BlockOutputStream(OutputStream out, int blockSize) Create a new instance which compresses with the standard LZ4 compression algorithm. | |
| LZ4BlockOutputStream | back to summary |
|---|---|
| public LZ4BlockOutputStream(OutputStream out) Create a new instance which compresses into blocks of 64 KB. | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this output stream and releases any system resources associated with the stream.
| |
| compressionLevel | back to summary |
|---|---|
| private static int compressionLevel(int blockSize) | |
| ensureNotFinished | back to summary |
|---|---|
| private void ensureNotFinished() | |
| finish | back to summary |
|---|---|
| public void finish() throws IOException Same as | |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Overrides java. Implements java. Flush this compressed
| |
| flushBufferedData | back to summary |
|---|---|
| private void flushBufferedData() throws IOException | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| write | back to summary |
|---|---|
| public void write(int b) throws IOException Overrides java. Doc from java. Writes the specified
The
Implements the abstract
| |
| write | back to summary |
|---|---|
| public void write(byte[] b, int off, int len) throws IOException Overrides java. Doc from java. Writes
| |
| write | back to summary |
|---|---|
| public void write(byte[] b) throws IOException Overrides java. Doc from java. Writes
| |
| writeIntLE | back to summary |
|---|---|
| private static void writeIntLE(int i, byte[] buf, int off) | |