Package com.rabbitmq.stream.compression
Interface CompressionCodec
- All Known Implementing Classes:
CompressionUtils.CommonsCompressGzipCompressionCodec
,CompressionUtils.CommonsCompressLz4CompressionCodec
,CompressionUtils.CommonsCompressSnappyCompressionCodec
,CompressionUtils.CommonsCompressZstdCompressionCodec
,CompressionUtils.GzipCompressionCodec
,CompressionUtils.Lz4JavaCompressionCodec
,CompressionUtils.XerialSnappyCompressionCodec
,CompressionUtils.ZstdJniCompressionCodec
public interface CompressionCodec
Codec to compress and decompress sub-entries.
-
Method Summary
Modifier and TypeMethodDescriptionbyte
code()
Return the code for this type of codec.compress
(OutputStream target) Creates anOutputStream
to compress data.decompress
(InputStream source) Creates anInputStream
to read decompressed data from.int
maxCompressedLength
(int sourceLength) Provides the maximum compressed size from the source length.
-
Method Details
-
maxCompressedLength
int maxCompressedLength(int sourceLength) Provides the maximum compressed size from the source length.- Parameters:
sourceLength
- size of plain, uncompressed data- Returns:
- maximum compressed size
-
compress
Creates anOutputStream
to compress data.- Parameters:
target
- the stream where compressed data will end up- Returns:
- output stream to write plain data to
-
decompress
Creates anInputStream
to read decompressed data from.- Parameters:
source
- the stream to read compressed data from- Returns:
- input stream to read decompressed data from
-
code
byte code()Return the code for this type of codec.- Returns:
- compression code
-