public static class CompressionStrategy.ZstdCompressor extends CompressionStrategy.Compressor
| Constructor and Description |
|---|
ZstdCompressor() |
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
allocateInBuffer(int inputSize,
Closer closer)
Allocates a buffer that should be passed to
CompressionStrategy.Compressor.compress(java.nio.ByteBuffer, java.nio.ByteBuffer) method as input buffer. |
ByteBuffer |
allocateOutBuffer(int inputSize,
Closer closer)
Allocates a buffer that should be passed to
CompressionStrategy.Compressor.compress(java.nio.ByteBuffer, java.nio.ByteBuffer) method as output buffer. |
ByteBuffer |
compress(ByteBuffer in,
ByteBuffer out)
Returns a ByteBuffer with compressed contents of in between it's position and limit.
|
public ByteBuffer allocateInBuffer(int inputSize, Closer closer)
CompressionStrategy.CompressorCompressionStrategy.Compressor.compress(java.nio.ByteBuffer, java.nio.ByteBuffer) method as input buffer. Different Compressors
require (or work more efficiently with) different kinds of buffers.
If the allocated buffer is a direct buffer, it should be registered to be freed with the given Closer.
allocateInBuffer in class CompressionStrategy.Compressorpublic ByteBuffer allocateOutBuffer(int inputSize, Closer closer)
CompressionStrategy.CompressorCompressionStrategy.Compressor.compress(java.nio.ByteBuffer, java.nio.ByteBuffer) method as output buffer. Different Compressors
require (or work more efficiently with) different kinds of buffers.
Allocates a buffer that is always enough to compress a byte sequence of the given size.
If the allocated buffer is a direct buffer, it should be registered to be freed with the given Closer.
allocateOutBuffer in class CompressionStrategy.Compressorpublic ByteBuffer compress(ByteBuffer in, ByteBuffer out)
CompressionStrategy.Compressorout's position and limit
are not respected and could be discarded.
Contents of in between it's position and limit are compressed. It's contents, position and limit
shouldn't be changed in compress() method.
compress in class CompressionStrategy.CompressorCopyright © 2011–2023 The Apache Software Foundation. All rights reserved.