Package org.opendaylight.raft.spi
Class Lz4Support
java.lang.Object
org.opendaylight.raft.spi.Lz4Support
Utilities supporting LZ4 compression and decompression.
-
Method Summary
Modifier and TypeMethodDescriptionstatic OutputStreamnewCompressOutputStream(OutputStream out, Lz4BlockSize blockSize) Creates a newOutputStreamthat will compress data using the LZ4 algorithm with independent blocks.static OutputStreamnewCompressOutputStream(OutputStream out, Lz4BlockSize blockSize, long knownSize) Creates a newOutputStreamthat will compress data using the LZ4 algorithm with independent blocks.static InputStreamReturns a newInputStreamthat will decompress data using the LZ4 algorithm.
-
Method Details
-
newDecompressInputStream
Returns a newInputStreamthat will decompress data using the LZ4 algorithm. This instance will decompress all concatenated frames in their sequential order.- Parameters:
in- the stream to decompress- Returns:
- an InputStream
- Throws:
IOException- if an I/O error occurs
-
newCompressOutputStream
public static OutputStream newCompressOutputStream(OutputStream out, Lz4BlockSize blockSize) throws IOException Creates a newOutputStreamthat will compress data using the LZ4 algorithm with independent blocks. Equivalent to.newCompressOutputStream(out, blockSiize, -1)- Parameters:
out- the output stream to compressblockSize- the block size to use- Returns:
- an OutputStream
- Throws:
IOException- if an I/O error occurs
-
newCompressOutputStream
public static OutputStream newCompressOutputStream(OutputStream out, Lz4BlockSize blockSize, long knownSize) throws IOException Creates a newOutputStreamthat will compress data using the LZ4 algorithm with independent blocks.- Parameters:
out- the output stream to compressblockSize- the block size to useknownSize- the size of the uncompressed data. A value less than zero means unknown.- Returns:
- an OutputStream
- Throws:
IOException- if an I/O error occurs
-