Class GZipCompressor<T extends java.nio.Buffer>

    • Field Detail

      • primitiveSize

        protected final int primitiveSize
      • buffer

        protected byte[] buffer
      • nioBuffer

        protected T extends java.nio.Buffer nioBuffer
    • Constructor Detail

      • GZipCompressor

        public GZipCompressor​(int primitiveSize)
    • Method Detail

      • compress

        public boolean compress​(T pixelData,
                                java.nio.ByteBuffer compressed)
        Description copied from interface: ICompressor
        compress the buffer into the byte buffer. Attention enough space must already be allocated.
        Specified by:
        compress in interface ICompressor<T extends java.nio.Buffer>
        Parameters:
        pixelData - the buffer to compress.
        compressed - the compressed data
        Returns:
        true if the compression succeeded.
      • decompress

        public void decompress​(java.nio.ByteBuffer compressed,
                               T pixelData)
        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 interface ICompressor<T extends java.nio.Buffer>
        Parameters:
        compressed - the compressed data
        pixelData - the buffer to fill with the uncompressed data.
      • createGZipInputStream

        protected java.util.zip.GZIPInputStream createGZipInputStream​(java.nio.ByteBuffer compressed)
                                                               throws java.io.IOException
        Throws:
        java.io.IOException
      • createGZipOutputStream

        protected java.util.zip.GZIPOutputStream createGZipOutputStream​(int length,
                                                                        java.nio.ByteBuffer compressed)
                                                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • getPixel

        protected abstract void getPixel​(T pixelData,
                                         byte[] pixelBytes)
      • setPixel

        protected abstract void setPixel​(T pixelData,
                                         byte[] pixelBytes)