private boolean readPort(){
  _currentUrlMarker.setIndex(UrlPart.PORT,_buffer.length());
  int portLen=0;
  while (!_reader.eof()) {
    char curr=_reader.read();
    portLen++;
    if (curr == '/') {
      _buffer.append(curr);
      return readPath();
    }
 else     if (curr == '?') {
      _buffer.append(curr);
      return readQueryString();
    }
 else     if (curr == '#') {
      _buffer.append(curr);
      return readFragment();
    }
 else     if (checkMatchingCharacter(curr) == CharacterMatch.CharacterMatchStop || !CharUtils.isNumeric(curr)) {
      _reader.goBack();
      if (portLen == 1) {
        _buffer.delete(_buffer.length() - 1,_buffer.length());
      }
      _currentUrlMarker.unsetIndex(UrlPart.PORT);
      return readEnd(ReadEndState.ValidUrl);
    }
 else {
      _buffer.append(curr);
    }
  }
  return readEnd(ReadEndState.ValidUrl);
}

private boolean readPort ( ) { _currentUrlMarker . setIndex ( UrlPart . PORT , _buffer . length ( ) ) ; int portLen = 0 ; while ( ! _reader . eof ( ) ) { char curr = _reader . read ( ) ; portLen ++ ; if ( curr == '/' ) { _buffer . append ( curr ) ; return readPath ( ) ; } else if ( curr == '?' ) { _buffer . append ( curr ) ; return readQueryString ( ) ; } else if ( curr == '#' ) { _buffer . append ( curr ) ; return readFragment ( ) ; } else if ( checkMatchingCharacter ( curr ) == CharacterMatch . CharacterMatchStop || ! CharUtils . isNumeric ( curr ) ) { _reader . goBack ( ) ; if ( portLen == 1 ) { _buffer . delete ( _buffer . length ( ) - 1 , _buffer . length ( ) ) ; } _currentUrlMarker . unsetIndex ( UrlPart . PORT ) ; return readEnd ( ReadEndState . ValidUrl ) ; } else { _buffer . append ( curr ) ; } } return readEnd ( ReadEndState . ValidUrl ) ; }
try to read the port of the url .
