net.jpountz.lz4
Class LZ4FrameOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- net.jpountz.lz4.LZ4FrameOutputStream
-
- All Implemented Interfaces:
- java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable
public class LZ4FrameOutputStream extends java.io.FilterOutputStreamA partial implementation of the v1.5.1 LZ4 Frame format. This class is NOT thread safe Not Supported: * Dependent blocks * Legacy streams * Multiple frames (one LZ4FrameOutputStream is one frame)- See Also:
- LZ4 Framing Format Spec 1.5.1 Originally based on kafka's KafkaLZ4BlockOutputStream
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classLZ4FrameOutputStream.BDstatic classLZ4FrameOutputStream.BLOCKSIZEstatic classLZ4FrameOutputStream.FLGstatic classLZ4FrameOutputStream.FrameInfo
-
Constructor Summary
Constructors Constructor and Description LZ4FrameOutputStream(java.io.OutputStream out)Create a newOutputStreamthat will compress data using the LZ4 algorithm.LZ4FrameOutputStream(java.io.OutputStream out, LZ4FrameOutputStream.BLOCKSIZE blockSize)Create a newOutputStreamthat will compress data using the LZ4 algorithm.LZ4FrameOutputStream(java.io.OutputStream out, LZ4FrameOutputStream.BLOCKSIZE blockSize, long knownSize, LZ4FrameOutputStream.FLG.Bits... bits)Create a newOutputStreamthat will compress data using the LZ4 algorithm.LZ4FrameOutputStream(java.io.OutputStream out, LZ4FrameOutputStream.BLOCKSIZE blockSize, LZ4FrameOutputStream.FLG.Bits... bits)Create a newOutputStreamthat will compress data using the LZ4 algorithm.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclose()voidflush()voidwrite(byte[] b, int off, int len)voidwrite(int b)
-
-
-
Constructor Detail
-
LZ4FrameOutputStream
public LZ4FrameOutputStream(java.io.OutputStream out, LZ4FrameOutputStream.BLOCKSIZE blockSize, LZ4FrameOutputStream.FLG.Bits... bits) throws java.io.IOExceptionCreate a newOutputStreamthat will compress data using the LZ4 algorithm.- Parameters:
out- The output stream to compressblockSize- The BLOCKSIZE to usebits- A set of features to use- Throws:
java.io.IOException
-
LZ4FrameOutputStream
public LZ4FrameOutputStream(java.io.OutputStream out, LZ4FrameOutputStream.BLOCKSIZE blockSize, long knownSize, LZ4FrameOutputStream.FLG.Bits... bits) throws java.io.IOExceptionCreate a newOutputStreamthat will compress data using the LZ4 algorithm.- Parameters:
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 use- Throws:
java.io.IOException
-
LZ4FrameOutputStream
public LZ4FrameOutputStream(java.io.OutputStream out, LZ4FrameOutputStream.BLOCKSIZE blockSize) throws java.io.IOExceptionCreate a newOutputStreamthat will compress data using the LZ4 algorithm.- Parameters:
out- The stream to compressblockSize- The BLOCKSIZE to use. Default: 4. The block size used during compression. 4=64kb, 5=256kb, 6=1mb, 7=4mb. All other values will generate an exception- Throws:
java.io.IOException
-
LZ4FrameOutputStream
public LZ4FrameOutputStream(java.io.OutputStream out) throws java.io.IOExceptionCreate a newOutputStreamthat will compress data using the LZ4 algorithm.- Parameters:
out- The output stream to compress- Throws:
java.io.IOException
-
-
Method Detail
-
write
public void write(int b) throws java.io.IOException- Overrides:
writein classjava.io.FilterOutputStream- Throws:
java.io.IOException
-
write
public void write(byte[] b, int off, int len) throws java.io.IOException- Overrides:
writein classjava.io.FilterOutputStream- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException- Specified by:
flushin interfacejava.io.Flushable- Overrides:
flushin classjava.io.FilterOutputStream- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfacejava.lang.AutoCloseable- Overrides:
closein classjava.io.FilterOutputStream- Throws:
java.io.IOException
-
-
DMelt 3.0 © DataMelt by jWork.ORG