code: public static Buffer consumeToken(final Buffer buffer) throws IndexOutOfBoundsException, IOException {
          final int count = getTokenCount(buffer);
          if (count == 0) {
              return null;
          }
          return buffer.readBytes(count);
      }
docs: Consume a token, which according to RFC3261 section 25.1 Basic Rules is:
  
  token = 1*(alphanum / "-" / "." / "!" / "%" / "*" / "_" / "+" / "`" / "'"
  / "~" )
  
  @param buffer
  @return the buffer containing the token we consumed or null if nothing
  was consumed.
  @throws IOException
  @throws IndexOutOfBoundsException