public abstract class GZipCompressor<T extends Buffer> extends 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,
ByteBuffer compressed)
compress the buffer into the byte buffer.
|
protected GZIPInputStream |
createGZipInputStream(ByteBuffer compressed) |
protected GZIPOutputStream |
createGZipOutputStream(int length,
ByteBuffer compressed) |
void |
decompress(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) |
public boolean compress(T pixelData, ByteBuffer compressed)
ICompressor
compress
in interface ICompressor<T extends Buffer>
pixelData
- the buffer to compress.compressed
- the compressed datapublic void decompress(ByteBuffer compressed, T pixelData)
ICompressor
decompress
in interface ICompressor<T extends Buffer>
compressed
- the compressed datapixelData
- the buffer to fill with the uncompressed data.protected GZIPInputStream createGZipInputStream(ByteBuffer compressed) throws IOException
IOException
protected GZIPOutputStream createGZipOutputStream(int length, ByteBuffer compressed) throws IOException
IOException
protected abstract void getPixel(T pixelData, byte[] pixelBytes)
protected abstract void setPixel(T pixelData, byte[] pixelBytes)
Copyright © 1996–2016 nom-tam-fits. All rights reserved.