public static boolean isInputStreamGZIPCompressed(final PushbackInputStream inputStream) throws IOException {
  if (inputStream == null)   return false;
  byte[] signature=new byte[2];
  int readStatus=inputStream.read(signature);
  inputStream.unread(signature);
  int streamHeader=((int)signature[0] & 0xff) | ((signature[1] << 8) & 0xff00);
  return readStatus == 2 && GZIPInputStream.GZIP_MAGIC == streamHeader;
}

public static boolean isInputStreamGZIPCompressed ( final PushbackInputStream inputStream ) throws IOException { if ( inputStream == null ) return false ; byte [ ] signature = new byte [ 2 ] ; int readStatus = inputStream . read ( signature ) ; inputStream . unread ( signature ) ; int streamHeader = ( ( int ) signature [ 0 ] & 0xff ) | ( ( signature [ 1 ] << 8 ) & 0xff00 ) ; return readStatus == 2 && GZIPInputStream . GZIP_MAGIC == streamHeader ; }
checks the inputstream if it contains gzip compressed data
