code: private HttpTokens.Token next(ByteBuffer buffer) {
          byte ch = buffer.get();
  
          HttpTokens.Token t = HttpTokens.TOKENS[0xff & ch];
  
          switch (t.getType()) {
              case CNTL:
                  throw new IllegalCharacterException(_state, t, buffer);
  
              case LF:
                  _cr = false;
                  break;
  
              case CR:
                  if (_cr)
                      throw new BadMessageException("Bad EOL");
  
                  _cr = true;
                  if (buffer.hasRemaining()) {
                      // Don't count the CRs and LFs of the chunked encoding.
                      if (_maxHeaderBytes > 0 && (_state == State.HEADER || _state == State.TRAILER))
                          _headerBytes++;
                      return next(buffer);
                  }
  
                  return null;
  
              case ALPHA:
              case DIGIT:
              case TCHAR:
              case VCHAR:
              case HTAB:
              case SPACE:
              case OTEXT:
              case COLON:
                  if (_cr)
                      throw new BadMessageException("Bad EOL");
                  break;
  
              default:
                  break;
          }
  
          return t;
      }
docs: /* -------------------------------------------------------------------------------