public class CompressedObjectStrategy<T extends Buffer> extends Object implements ObjectStrategy<ResourceHolder<T>>
| Modifier and Type | Class and Description |
|---|---|
static interface |
CompressedObjectStrategy.BufferConverter<T> |
static class |
CompressedObjectStrategy.CompressionStrategy
Compression strategy is used to compress block of bytes without knowledge of what data the bytes represents.
|
static interface |
CompressedObjectStrategy.Compressor |
static interface |
CompressedObjectStrategy.Decompressor |
static class |
CompressedObjectStrategy.LZ4Compressor |
static class |
CompressedObjectStrategy.LZ4Decompressor |
static class |
CompressedObjectStrategy.LZFCompressor |
static class |
CompressedObjectStrategy.LZFDecompressor |
static class |
CompressedObjectStrategy.UncompressedCompressor |
static class |
CompressedObjectStrategy.UncompressedDecompressor |
| Modifier and Type | Field and Description |
|---|---|
protected CompressedObjectStrategy.BufferConverter<T> |
converter |
protected CompressedObjectStrategy.Decompressor |
decompressor |
static CompressedObjectStrategy.CompressionStrategy |
DEFAULT_COMPRESSION_STRATEGY |
protected ByteOrder |
order |
| Modifier | Constructor and Description |
|---|---|
protected |
CompressedObjectStrategy(ByteOrder order,
CompressedObjectStrategy.BufferConverter<T> converter,
CompressedObjectStrategy.CompressionStrategy compression) |
| Modifier and Type | Method and Description |
|---|---|
protected ByteBuffer |
bufferFor(T val) |
int |
compare(ResourceHolder<T> o1,
ResourceHolder<T> o2) |
protected void |
decompress(ByteBuffer buffer,
int numBytes,
ByteBuffer buf) |
ResourceHolder<T> |
fromByteBuffer(ByteBuffer buffer,
int numBytes)
Convert values from their underlying byte representation.
|
Class<? extends ResourceHolder<T>> |
getClazz() |
byte[] |
toBytes(ResourceHolder<T> holder) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcomparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLongpublic static final CompressedObjectStrategy.CompressionStrategy DEFAULT_COMPRESSION_STRATEGY
protected final ByteOrder order
protected final CompressedObjectStrategy.BufferConverter<T extends Buffer> converter
protected final CompressedObjectStrategy.Decompressor decompressor
protected CompressedObjectStrategy(ByteOrder order, CompressedObjectStrategy.BufferConverter<T> converter, CompressedObjectStrategy.CompressionStrategy compression)
public Class<? extends ResourceHolder<T>> getClazz()
getClazz in interface ObjectStrategy<ResourceHolder<T extends Buffer>>public ResourceHolder<T> fromByteBuffer(ByteBuffer buffer, int numBytes)
ObjectStrategyfromByteBuffer in interface ObjectStrategy<ResourceHolder<T extends Buffer>>buffer - buffer to read value fromnumBytes - number of bytes used to store the value, starting at buffer.position()protected void decompress(ByteBuffer buffer, int numBytes, ByteBuffer buf)
public byte[] toBytes(ResourceHolder<T> holder)
toBytes in interface ObjectStrategy<ResourceHolder<T extends Buffer>>protected ByteBuffer bufferFor(T val)
public int compare(ResourceHolder<T> o1, ResourceHolder<T> o2)
compare in interface Comparator<ResourceHolder<T extends Buffer>>Copyright © 2011–2017. All rights reserved.