Class BlockLZ4CompressorOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
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:
- This class is not thread-safe
-
Field Summary
Fields inherited from class java.io.FilterOutputStream
out
-
Constructor Summary
ConstructorDescriptionCreates a new LZ4 output stream.BlockLZ4CompressorOutputStream
(OutputStream out, Parameters params) Creates a new LZ4 output stream. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
static Parameters.Builder
Returns a builder correctly configured for the LZ4 algorithm.void
finish()
Compresses all remaining data and writes it to the stream, doesn't close the underlying stream.void
prefill
(byte[] data, int off, int len) Adds some initial data to fill the window with.void
write
(byte[] data, int off, int len) void
write
(int b) Methods inherited from class org.apache.commons.compress.compressors.CompressorOutputStream
out
Methods inherited from class java.io.FilterOutputStream
flush, write
-
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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterOutputStream
- Throws:
IOException
-
finish
Compresses all remaining data and writes it to the stream, doesn't close the underlying stream.- 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:
write
in classFilterOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-