public class LZ4FrameOutputStream extends FilterOutputStream
Not Supported:
Originally based on kafka's KafkaLZ4BlockOutputStream.
Modifier and Type | Class and Description |
---|---|
static class |
LZ4FrameOutputStream.BD |
static class |
LZ4FrameOutputStream.BLOCKSIZE |
static class |
LZ4FrameOutputStream.FLG |
out
Constructor and Description |
---|
LZ4FrameOutputStream(OutputStream out)
Creates a new
OutputStream that will compress data using the LZ4 algorithm with 4-MB blocks. |
LZ4FrameOutputStream(OutputStream out,
LZ4FrameOutputStream.BLOCKSIZE blockSize)
Creates a new
OutputStream that will compress data using the LZ4 algorithm. |
LZ4FrameOutputStream(OutputStream out,
LZ4FrameOutputStream.BLOCKSIZE blockSize,
long knownSize,
LZ4FrameOutputStream.FLG.Bits... bits)
Creates a new
OutputStream that will compress data using using fastest instances of LZ4Compressor and XXHash32 . |
LZ4FrameOutputStream(OutputStream out,
LZ4FrameOutputStream.BLOCKSIZE blockSize,
LZ4FrameOutputStream.FLG.Bits... bits)
Creates a new
OutputStream that will compress data of unknown size using the LZ4 algorithm. |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
write
public LZ4FrameOutputStream(OutputStream out, LZ4FrameOutputStream.BLOCKSIZE blockSize, LZ4FrameOutputStream.FLG.Bits... bits) throws IOException
OutputStream
that will compress data of unknown size using the LZ4 algorithm.out
- the output stream to compressblockSize
- the BLOCKSIZE to usebits
- a set of features to useIOException
- if an I/O error occursLZ4FrameOutputStream(OutputStream, BLOCKSIZE, long, FLG.Bits...)
public LZ4FrameOutputStream(OutputStream out, LZ4FrameOutputStream.BLOCKSIZE blockSize, long knownSize, LZ4FrameOutputStream.FLG.Bits... bits) throws IOException
OutputStream
that will compress data using using fastest instances of LZ4Compressor
and XXHash32
.out
- the output stream to compressblockSize
- the BLOCKSIZE to useknownSize
- the size of the uncompressed data. A value less than zero means unknown.bits
- a set of features to useIOException
- if an I/O error occurspublic LZ4FrameOutputStream(OutputStream out, LZ4FrameOutputStream.BLOCKSIZE blockSize) throws IOException
OutputStream
that will compress data using the LZ4 algorithm. The block independence flag is set, and none of the other flags are set.out
- The stream to compressblockSize
- the BLOCKSIZE to useIOException
- if an I/O error occursLZ4FrameOutputStream(OutputStream, BLOCKSIZE, FLG.Bits...)
public LZ4FrameOutputStream(OutputStream out) throws IOException
OutputStream
that will compress data using the LZ4 algorithm with 4-MB blocks.out
- the output stream to compressIOException
- if an I/O error occursLZ4FrameOutputStream(OutputStream, BLOCKSIZE)
public void write(int b) throws IOException
write
in class FilterOutputStream
IOException
public void write(byte[] b, int off, int len) throws IOException
write
in class FilterOutputStream
IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class FilterOutputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class FilterOutputStream
IOException