Class GZipCompressor<T extends Buffer>
java.lang.Object
nom.tam.fits.compression.algorithm.gzip.GZipCompressor<T>
- Type Parameters:
T
- The genetic type of element buffer to compress
- All Implemented Interfaces:
ICompressor<T>
- Direct Known Subclasses:
GZip2Compressor
,GZipCompressor.ByteGZipCompressor
,GZipCompressor.DoubleGZipCompressor
,GZipCompressor.FloatGZipCompressor
,GZipCompressor.IntGZipCompressor
,GZipCompressor.LongGZipCompressor
,GZipCompressor.ShortGZipCompressor
(for internal use) The GZIP compression algorithm.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Byte compress is a special case, the only one that does not extends GZipCompress because it can write the buffer directly.static class
static class
static class
static class
static class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
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
protected abstract void
-
Field Details
-
primitiveSize
protected final int primitiveSize -
buffer
protected byte[] buffer -
nioBuffer
-
-
Constructor Details
-
GZipCompressor
public GZipCompressor(int primitiveSize)
-
-
Method Details
-
compress
Description copied from interface:ICompressor
compress the buffer into the byte buffer. Attention enough space must already be allocated.- Specified by:
compress
in interfaceICompressor<T extends Buffer>
- Parameters:
pixelData
- the buffer to compress.compressed
- the compressed data- Returns:
- true if the compression succeeded.
-
decompress
Description copied from interface:ICompressor
Decompress the byte buffer and restore the buffer from it, again enough space must already be allocated.- Specified by:
decompress
in interfaceICompressor<T extends Buffer>
- Parameters:
compressed
- the compressed datapixelData
- the buffer to fill with the uncompressed data.
-
createGZipInputStream
- Throws:
IOException
-
createGZipOutputStream
protected GZIPOutputStream createGZipOutputStream(int length, ByteBuffer compressed) throws IOException - Throws:
IOException
-
getPixel
-
setPixel
-