Class GZipUtil


  • public class GZipUtil
    extends java.lang.Object
    GZip-related utilities.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static byte[] MAGIC_NUMBER
      GZIP header magic number bytes, like found in a gzipped files, which are encoded in Intel format (i.e. little endian).
    • Constructor Summary

      Constructors 
      Constructor Description
      GZipUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isGZipStream​(java.io.InputStream in)
      Check if a stream is a GZIP stream, by checking the first bytes of the stream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MAGIC_NUMBER

        private static final byte[] MAGIC_NUMBER
        GZIP header magic number bytes, like found in a gzipped files, which are encoded in Intel format (i.e. little endian).
    • Constructor Detail

      • GZipUtil

        public GZipUtil()
    • Method Detail

      • isGZipStream

        public static boolean isGZipStream​(java.io.InputStream in)
                                    throws java.io.IOException
        Check if a stream is a GZIP stream, by checking the first bytes of the stream.
        Parameters:
        in - input stream
        Returns:
        true if a stream is a GZIP stream
        Throws:
        java.io.IOException