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 OutputStream
newCompressOutputStream
(OutputStream out, Lz4BlockSize blockSize) Creates a newOutputStream
that will compress data using the LZ4 algorithm with independent blocks.static OutputStream
newCompressOutputStream
(OutputStream out, Lz4BlockSize blockSize, long knownSize) Creates a newOutputStream
that will compress data using the LZ4 algorithm with independent blocks.static InputStream
Returns a newInputStream
that will decompress data using the LZ4 algorithm.
-
Method Details
-
newDecompressInputStream
Returns a newInputStream
that 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 newOutputStream
that will compress data using the LZ4 algorithm with independent blocks. Equivalent tonewCompressOutputStream(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 newOutputStream
that 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
-