Class BlockLZ4CompressorOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
org.apache.commons.compress.CompressFilterOutputStream<OutputStream>
org.apache.commons.compress.compressors.CompressorOutputStream<OutputStream>
org.apache.commons.compress.compressors.lz4.BlockLZ4CompressorOutputStream
- All Implemented Interfaces:
Closeable, Flushable, AutoCloseable
CompressorOutputStream for the LZ4 block format.
- Since:
- 1.14
- See Also:
-
Field Summary
Fields inherited from class FilterOutputStream
out -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new LZ4 output stream.BlockLZ4CompressorOutputStream(OutputStream out, Parameters params) Creates a new LZ4 output stream. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static Parameters.BuilderReturns a builder correctly configured for the LZ4 algorithm.voidfinish()Compresses all remaining data and writes it to the stream, doesn't close the underlying stream.voidprefill(byte[] data, int off, int len) Adds some initial data to fill the window with.voidwrite(byte[] data, int off, int len) voidwrite(int b) Methods inherited from class CompressFilterOutputStream
checkOpen, isClosed, isFinished, out, write, write, writeUsAscii, writeUsAsciiRaw, writeUtf8Methods inherited from class FilterOutputStream
flush, writeMethods inherited from class OutputStream
nullOutputStream
-
Constructor Details
-
BlockLZ4CompressorOutputStream
Creates a new LZ4 output stream.- Parameters:
out- An OutputStream to read compressed data from
-
BlockLZ4CompressorOutputStream
Creates a new LZ4 output stream.- Parameters:
out- An OutputStream to read compressed data fromparams- The parameters to use for LZ77 compression.
-
-
Method Details
-
createParameterBuilder
Returns a builder correctly configured for the LZ4 algorithm.- Returns:
- a builder correctly configured for the LZ4 algorithm
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classCompressFilterOutputStream<OutputStream>- Throws:
IOException
-
finish
Compresses all remaining data and writes it to the stream, doesn't close the underlying stream.- Overrides:
finishin classCompressFilterOutputStream<OutputStream>- Throws:
IOException- if an error occurs
-
prefill
Adds some initial data to fill the window with.- Parameters:
data- the data to fill the window with.off- offset of real data into the arraylen- amount of data- Throws:
IllegalStateException- if the stream has already started to write data- See Also:
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-