Class GZipCompressInputStream

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class GZipCompressInputStream
    extends DeflaterInputStream
    This is the Gzip input stream wrapper, which will take normal input stream, compress it and provide gzip compressed input stream.
    • Constructor Detail

      • GZipCompressInputStream

        public GZipCompressInputStream​(InputStream in)
        Constructor which wraps given input stream.
        Parameters:
        in - InputStream object
    • Method Detail

      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws IOException
        Overridden read method which will inject proper gzip header and gzip tail.
        Overrides:
        read in class DeflaterInputStream
        Parameters:
        b - buffer to read into.
        off - offset
        len - length
        Returns:
        cnt number of bytes read.
        Throws:
        IOException