code: private int readHeader(InputStream this_in) throws IOException {
          CheckedInputStream in = new CheckedInputStream(this_in, crc);
          crc.reset();
          // Check header magic
          if (readUShort(in) != GZIP_MAGIC) {
              throw new ZipException("Not in GZIP format");
          }
          // Check compression method
          if (readUByte(in) != 8) {
              throw new ZipException("Unsupported compression method");
          }
          // Read flags
          int flg = readUByte(in);
          // Skip MTIME, XFL, and OS fields
          skipBytes(in, 6);
          int n = 2 + 2 + 6;
          // Skip optional extra field
          if ((flg & FEXTRA) == FEXTRA) {
              int m = readUShort(in);
              skipBytes(in, m);
              n += m + 2;
          }
          // Skip optional file name
          if ((flg & FNAME) == FNAME) {
              do {
                  n++;
              } while (readUByte(in) != 0);
          }
          // Skip optional file comment
          if ((flg & FCOMMENT) == FCOMMENT) {
              do {
                  n++;
              } while (readUByte(in) != 0);
          }
          // Check optional header CRC
          if ((flg & FHCRC) == FHCRC) {
              int v = (int)crc.getValue() & 0xffff;
              if (readUShort(in) != v) {
                  throw new ZipException("Corrupt GZIP header");
              }
              n += 2;
          }
          crc.reset();
          return n;
      }
docs: /*
  Reads GZIP member header and returns the total byte number
  of this member header.