Constructor and Description |
---|
BufferCompressor(int bufferSize,
String factoryName) |
Modifier and Type | Method and Description |
---|---|
Buffer |
compressToIntermediateBuffer(Buffer buffer)
Compresses the given
Buffer using BlockCompressor . |
Buffer |
compressToOriginalBuffer(Buffer buffer)
The difference between this method and
compressToIntermediateBuffer(Buffer) is that
this method will copy the compressed data back to the input Buffer starting from
offset 0. |
public BufferCompressor(int bufferSize, String factoryName)
public Buffer compressToIntermediateBuffer(Buffer buffer)
Buffer
using BlockCompressor
. The compressed data will
be stored in the intermediate buffer of this BufferCompressor
and returned to the
caller. The caller must guarantee that the returned Buffer
has been freed when
calling the method next time.
Notes that the compression will always start from offset 0 to the size of the input Buffer
.
public Buffer compressToOriginalBuffer(Buffer buffer)
compressToIntermediateBuffer(Buffer)
is that
this method will copy the compressed data back to the input Buffer
starting from
offset 0.
The caller must guarantee that the input Buffer
is writable.
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.