public static interface CompressionCodecFactory.BytesInputDecompressor
This decompressor shall be released after use. This decompressor shall not be used after release.
release()| Modifier and Type | Method and Description |
|---|---|
void |
decompress(ByteBuffer input,
int compressedSize,
ByteBuffer output,
int decompressedSize)
Decompresses
compressedSize bytes from input from the current position. |
BytesInput |
decompress(BytesInput bytes,
int decompressedSize)
Decompresses the specified
BytesInput data and returns it as BytesInput. |
void |
release()
Releases this decompressor instance.
|
BytesInput decompress(BytesInput bytes, int decompressedSize) throws IOException
BytesInput data and returns it as BytesInput.
The decompressed data must have the size specified. Depending on the implementation bytes might be
completely consumed. The returned BytesInput instance needs to be consumed before using this decompressor
again. This is because the implementation might use its internal buffer to directly provide the returned
BytesInput instance.
bytes - the page data to be decompresseddecompressedSize - the exact size of the decompressed dataBytesInput containing the decompressed data. Needs to be consumed before using this
decompressor again.IOException - if any I/O error occurs during the decompressionvoid decompress(ByteBuffer input, int compressedSize, ByteBuffer output, int decompressedSize) throws IOException
compressedSize bytes from input from the current position. The decompressed bytes is
to be written int output from its current position. The decompressed data must have the size specified.
output must have the available bytes of decompressedSize. According to the ByteBuffer
contract the position of input will be increased by compressedSize, and the position of
output will be increased by decompressedSize. (It means, one would have to flip the output buffer
before reading the decompressed data from it.)
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) dataIOException - if any I/O error occurs during the decompressionvoid release()
BytesInput
instance returned by decompress(BytesInput, int) shall be used after release.Copyright © 2023 The Apache Software Foundation. All rights reserved.