java.lang.Comparable<PeerID>
public class PeerID extends java.lang.Object implements java.lang.Comparable<PeerID>
コンストラクタ | 説明 |
---|---|
PeerID(byte[] id,
Destination address) |
|
PeerID(byte[] dest_hash,
I2PSnarkUtil util) |
Creates a PeerID from a destHash
|
PeerID(java.util.Map<java.lang.String,BEValue> m) |
Creates a PeerID from a Map containing BEncoded peer id, ip and
port.
|
PeerID(BDecoder be) |
Creates a PeerID from a BDecoder.
|
修飾子とタイプ | メソッド | 説明 |
---|---|---|
int |
compareTo(PeerID pid) |
推奨されていません。
unused? and will NPE now that address can be null?
|
boolean |
equals(java.lang.Object o) |
Two PeerIDs are equal when they have the same dest hash
|
Destination |
getAddress() |
Get the destination.
|
byte[] |
getDestHash() |
|
byte[] |
getID() |
|
int |
getPort() |
|
int |
hashCode() |
The hash code of a PeerID is the hashcode of the desthash
|
static java.lang.String |
idencode(byte[] bs) |
Encode an id as a hex encoded string and remove leading zeros.
|
boolean |
sameID(PeerID pid) |
Returns true if and only if this peerID and the given peerID have
the same destination hash
|
void |
setID(byte[] xid) |
for connecting out to peer based on desthash @since 0.8.1
|
java.lang.String |
toString() |
Returns the String "id@address" where id is the first 4 chars of the base64 encoded id
and address is the first 6 chars of the base64 dest (was the base64 hash of the dest) which
should match what the bytemonsoon tracker reports on its web pages.
|
public PeerID(byte[] id, Destination address)
public PeerID(BDecoder be) throws java.io.IOException
java.io.IOException
public PeerID(java.util.Map<java.lang.String,BEValue> m) throws InvalidBEncodingException, java.net.UnknownHostException
InvalidBEncodingException
java.net.UnknownHostException
public PeerID(byte[] dest_hash, I2PSnarkUtil util) throws InvalidBEncodingException
util
- for eventual destination lookupInvalidBEncodingException
public byte[] getID()
public void setID(byte[] xid)
public Destination getAddress()
public int getPort()
public byte[] getDestHash()
public int hashCode()
hashCode
クラス内 java.lang.Object
public boolean sameID(PeerID pid)
public boolean equals(java.lang.Object o)
equals
クラス内 java.lang.Object
@Deprecated public int compareTo(PeerID pid)
compareTo
インタフェース内 java.lang.Comparable<PeerID>
public java.lang.String toString()
toString
クラス内 java.lang.Object
public static java.lang.String idencode(byte[] bs)