public abstract class GZipCompressor<T extends java.nio.Buffer> extends java.lang.Object implements ICompressor<T>
Modifier and Type | Class and Description |
---|---|
static class |
GZipCompressor.ByteGZipCompressor
Byte compress is a special case, the only one that does not extends
GZipCompress because it can write the buffer directly.
|
static class |
GZipCompressor.DoubleGZipCompressor |
static class |
GZipCompressor.FloatGZipCompressor |
static class |
GZipCompressor.IntGZipCompressor |
static class |
GZipCompressor.LongGZipCompressor |
static class |
GZipCompressor.ShortGZipCompressor |
Modifier and Type | Field and Description |
---|---|
protected byte[] |
buffer |
protected T |
nioBuffer |
protected int |
primitiveSize |
Constructor and Description |
---|
GZipCompressor(int primitiveSize) |
Modifier and Type | Method and Description |
---|---|
boolean |
compress(T pixelData,
java.nio.ByteBuffer compressed)
compress the buffer into the byte buffer.
|
protected java.util.zip.GZIPInputStream |
createGZipInputStream(java.nio.ByteBuffer compressed) |
protected java.util.zip.GZIPOutputStream |
createGZipOutputStream(int length,
java.nio.ByteBuffer compressed) |
void |
decompress(java.nio.ByteBuffer compressed,
T pixelData)
Decompress the byte buffer and restore the buffer from it, again enough
space must already be allocated.
|
protected abstract void |
getPixel(T pixelData,
byte[] pixelBytes) |
protected abstract void |
setPixel(T pixelData,
byte[] pixelBytes) |
protected final int primitiveSize
protected byte[] buffer
protected T extends java.nio.Buffer nioBuffer
public boolean compress(T pixelData, java.nio.ByteBuffer compressed)
ICompressor
compress
in interface ICompressor<T extends java.nio.Buffer>
pixelData
- the buffer to compress.compressed
- the compressed datapublic void decompress(java.nio.ByteBuffer compressed, T pixelData)
ICompressor
decompress
in interface ICompressor<T extends java.nio.Buffer>
compressed
- the compressed datapixelData
- the buffer to fill with the uncompressed data.protected java.util.zip.GZIPInputStream createGZipInputStream(java.nio.ByteBuffer compressed) throws java.io.IOException
java.io.IOException
protected java.util.zip.GZIPOutputStream createGZipOutputStream(int length, java.nio.ByteBuffer compressed) throws java.io.IOException
java.io.IOException
protected abstract void getPixel(T pixelData, byte[] pixelBytes)
protected abstract void setPixel(T pixelData, byte[] pixelBytes)