public BEValue toBEValue() throws UnsupportedEncodingException {
    Map<String, BEValue> peer = new HashMap<String, BEValue>();
    if (this.hasPeerId()) {
      peer.put("peer id", new BEValue(this.getPeerIdArray()));
    }
    peer.put("ip", new BEValue(this.getIp(), Constants.BYTE_ENCODING));
    peer.put("port", new BEValue(this.getPort()));
    return new BEValue(peer);
  }
public BEValue toBEValue ( ) throws UnsupportedEncodingException { Map < String , BEValue > peer = new HashMap < String , BEValue > ( ) ; if ( this . hasPeerId ( ) ) { peer . put ( "peer id" , new BEValue ( this . getPeerIdArray ( ) ) ) ; } peer . put ( "ip" , new BEValue ( this . getIp ( ) , Constants . BYTE_ENCODING ) ) ; peer . put ( "port" , new BEValue ( this . getPort ( ) ) ) ; return new BEValue ( peer ) ; }
Returns a BEValue representing this peer for inclusion in an
announce reply from the tracker.
<p>
The returned BEValue is a dictionary containing the peer ID (in its
original byte-encoded form), the peer's IP and the peer's port.