Interface CompressionCodecFactory.BytesInputDecompressor
-
- Enclosing interface:
- CompressionCodecFactory
public static interface CompressionCodecFactory.BytesInputDecompressorDecompressor instance of a specific codec to be used for decompressing page data.This decompressor shall be released after use. This decompressor shall not be used after release.
- See Also:
release()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddecompress(ByteBuffer input, int compressedSize, ByteBuffer output, int decompressedSize)DecompressescompressedSizebytes frominputfrom the current position.BytesInputdecompress(BytesInput bytes, int decompressedSize)Decompresses the specifiedBytesInputdata and returns it asBytesInput.voidrelease()Releases this decompressor instance.
-
-
-
Method Detail
-
decompress
BytesInput decompress(BytesInput bytes, int decompressedSize) throws IOException
Decompresses the specifiedBytesInputdata and returns it asBytesInput.The decompressed data must have the size specified. Depending on the implementation
bytesmight be completely consumed. The returnedBytesInputinstance needs to be consumed before using this decompressor again. This is because the implementation might use its internal buffer to directly provide the returnedBytesInputinstance.- Parameters:
bytes- the page data to be decompresseddecompressedSize- the exact size of the decompressed data- Returns:
- a
BytesInputcontaining the decompressed data. Needs to be consumed before using this decompressor again. - Throws:
IOException- if any I/O error occurs during the decompression
-
decompress
void decompress(ByteBuffer input, int compressedSize, ByteBuffer output, int decompressedSize) throws IOException
DecompressescompressedSizebytes frominputfrom the current position. The decompressed bytes is to be written intoutputfrom its current position. The decompressed data must have the size specified.outputmust have the available bytes ofdecompressedSize. According to theByteBuffercontract the position ofinputwill be increased bycompressedSize, and the position ofoutputwill be increased bydecompressedSize. (It means, one would have to flip the output buffer before reading the decompressed data from it.)- Parameters:
input- the input buffer where the data is to be decompressed fromcompressedSize- the exact size of the compressed (input) dataoutput- the output buffer where the data is to be decompressed intodecompressedSize- the exact size of the decompressed (output) data- Throws:
IOException- if any I/O error occurs during the decompression
-
release
void release()
Releases this decompressor instance. No subsequent calls on this instance nor the returnedBytesInputinstance returned bydecompress(BytesInput, int)shall be used after release.
-
-