Class ICompressor.GZIPCompressor

    • Constructor Detail

      • GZIPCompressor

        public GZIPCompressor()
    • Method Detail

      • compress

        public byte[] compress​(byte[] data,
                               int offset,
                               int length)
                        throws IOException
        Description copied from interface: ICompressor
        abstract method of compress. this method has an important overhead due to the fact that it needs to allocate a byte array to compress into, and then needs to resize this buffer to the actual compressed length.
        Specified by:
        compress in interface ICompressor
        Returns:
        byte array of compressed data.
        Throws:
        IOException
      • getMaxBytesForCompression

        public int getMaxBytesForCompression​(int uncompressedDataSize)
        Description copied from interface: ICompressor
        Get the maximum byte size needed for compressing data of the given byte size. For GZIP, this method is insecure and may cause GZIPCompressOverflowException
        Specified by:
        getMaxBytesForCompression in interface ICompressor
        Parameters:
        uncompressedDataSize - byte size of the data to compress
        Returns:
        maximum byte size of the compressed data