docs: private int parseHeader(byte[] data) throws DataFormatException {
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
              Tr.debug(tc, "Parsing gzip header; state=" + this.state);
          }
          int pos = 0;
          for (; pos < data.length && PARSE_STATE.DONE != this.state;) {
              byte b = data[pos++];
              if (PARSE_STATE.ID1 == this.state) {
                  if ((byte) 0x1F != b) {
                      throw new DataFormatException("Invalid gzip header, first byte=" + b);
                  }
                  this.state = PARSE_STATE.ID2;
              } else if (PARSE_STATE.ID2 == this.state) {
                  if ((byte) 0x8B != b) {
                      throw new DataFormatException("Invalid gzip header, second byte=" + b);
                  }
                  this.state = PARSE_STATE.COMPRESSION;
              } else if (PARSE_STATE.COMPRESSION == this.state) {
                  if (Deflater.DEFLATED != b) {
                      throw new DataFormatException("Invalid gzip compression method=" + b);
                  }
                  this.state = PARSE_STATE.FLAG;
              } else if (PARSE_STATE.FLAG == this.state) {
                  if (-1 == this.gzipFlag) {
                      // after saving the extra flag byte, skip the next 6 bytes
                      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                          Tr.debug(tc, "gzip header flag=" + b);
                      }
                      this.gzipFlag = b;
                      pos = skip(data, pos, 6);
                  } else {
                      // previously saw the flag but didn't skip a full 6
                      pos = skip(data, pos, this.parseInt);
                  }
                  if (0 == this.parseInt) {
                      if (isFExtraSet()) {
                          this.state = PARSE_STATE.FEXTRA;
                      } else if (isFNameSet()) {
                          this.state = PARSE_STATE.FNAME;
                      } else if (isFCommentSet()) {
                          this.state = PARSE_STATE.FCOMMENT;
                      } else if (isFHCRCSet()) {
                          this.state = PARSE_STATE.FHCRC;
                      } else {
                          this.state = PARSE_STATE.DONE;
                      }
                      this.parseOffset = 0;
                  }
              } else if (PARSE_STATE.FEXTRA == this.state) {
                  // FEXTRA has length in 2 bytes, then that many bytes
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, "Parsing FEXTRA data, offset=" + this.parseOffset);
                  }
                  if (0 == this.parseOffset) {
                      this.parseInt = b;
                      this.parseOffset++;
                      continue;
                  } else if (1 == this.parseOffset) {
                      this.parseInt = (b << 8) | this.parseInt;
                      this.parseOffset++;
                  }
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, "FEXTRA length is " + this.parseInt);
                  }
                  pos = skip(data, pos, this.parseInt);
                  if (0 == this.parseInt) {
                      if (isFNameSet()) {
                          this.state = PARSE_STATE.FNAME;
                      } else if (isFCommentSet()) {
                          this.state = PARSE_STATE.FCOMMENT;
                      } else if (isFHCRCSet()) {
                          this.state = PARSE_STATE.FHCRC;
                      } else {
                          this.state = PARSE_STATE.DONE;
                      }
                      this.parseOffset = 0;
                  }
              } else if (PARSE_STATE.FNAME == this.state) {
                  // FNAME is a zero delimited file name
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, "Parsing FNAME data");
                  }
                  if (0 != b) {
                      pos = skipPast(data, pos, (byte) 0);
                  }
                  if (data.length == pos) {
                      return pos;
                  }
                  if (isFCommentSet()) {
                      this.state = PARSE_STATE.FCOMMENT;
                  } else if (isFHCRCSet()) {
                      this.state = PARSE_STATE.FHCRC;
                  } else {
                      this.state = PARSE_STATE.DONE;
                  }
              } else if (PARSE_STATE.FCOMMENT == this.state) {
                  // FCOMMENT is a zero delimited file comment
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, "Parsing FCOMMENT data");
                  }
                  if (0 != b) {
                      pos = skipPast(data, pos, (byte) 0);
                  }
                  if (data.length == pos) {
                      return pos;
                  }
                  if (isFHCRCSet()) {
                      this.state = PARSE_STATE.FHCRC;
                  } else {
                      this.state = PARSE_STATE.DONE;
                  }
              } else if (PARSE_STATE.FHCRC == this.state) {
                  // FHCRC has 2 extra bytes (checksum of all gzip header bytes)
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, "Parsing FHCRC data; offset=" + this.parseOffset);
                  }
                  this.parseOffset++;
                  if (2 > this.parseOffset) {
                      continue;
                  }
                  this.state = PARSE_STATE.DONE;
              }
          } // end loop
  
          if (PARSE_STATE.DONE == this.state) {
              this.parseOffset = 0;
              this.parseInt = 0;
          }
          return pos;
      }