code: public static boolean isCompressed(byte[] bytes) {
      if ((bytes == null) || (bytes.length < 2)) {
        return false;
      } else {
        return ((bytes[0] == (byte) (GZIPInputStream.GZIP_MAGIC)) &&
            (bytes[1] == (byte) (GZIPInputStream.GZIP_MAGIC >> 8)));
      }
    }
docs: /*
  Determines if a byte array is compressed. The java.util.zip GZip
  implementation does not expose the GZip header so it is difficult to determine
  if a string is compressed.
  Copied from Helix GZipCompressionUtil
  @param bytes an array of bytes
  @return true if the array is compressed or false otherwise