本文整理了Java中net.i2p.data.Hash.toString()
方法的一些代码示例,展示了Hash.toString()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hash.toString()
方法的具体详情如下:
包路径:net.i2p.data.Hash
类名称:Hash
方法名:toString
暂无
代码示例来源:origin: i2p/i2p.i2p
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
buf.append("Transient DataStore: ").append(_data.size()).append("\nKeys: ");
for (Map.Entry<Hash, DatabaseEntry> e : _data.entrySet()) {
Hash key = e.getKey();
DatabaseEntry dp = e.getValue();
buf.append("\n\t*Key: ").append(key.toString()).append("\n\tContent: ").append(dp.toString());
}
buf.append("\n");
return buf.toString();
}
代码示例来源:origin: i2p/i2p.i2p
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
if (_dest != null)
buf.append(_dest.calculateHash().toString());
else
buf.append(_host);
buf.append(':');
buf.append(_port);
return buf.toString();
}
代码示例来源:origin: i2p/i2p.i2p
@Override
public String toString() {
if (_ip != null) {
return Addresses.toString(_ip, _port);
} else {
return _peerHash.toString();
}
}
}
代码示例来源:origin: i2p/i2p.i2p
/**
* May not be valid if released, or may NPE on race with release, use with care in exception text
*/
@Override
public String toString() {
StringBuilder buf = new StringBuilder(256);
buf.append("IB Message: ").append(_messageId);
buf.append(" from ").append(_from.toString());
if (isComplete()) {
buf.append(" completely received with ");
//buf.append(getCompleteSize()).append(" bytes");
// may display -1 but avoid cascaded exceptions after release
buf.append(_completeSize).append(" bytes in ");
buf.append(_lastFragment + 1).append(" fragments");
} else {
for (int i = 0; i <= _lastFragment; i++) {
buf.append(" fragment ").append(i);
if (_fragments[i] != null)
buf.append(": known at size ").append(_fragments[i].getValid());
else
buf.append(": unknown");
}
}
buf.append(" lifetime: ").append(getLifetime());
return buf.toString();
}
}
代码示例来源:origin: i2p/i2p.i2p
@Test
public void testToString() throws Exception {
Destination dest = I2PClientFactory.createClient().createDestination(new ByteArrayOutputStream());
I2PSocketAddress addr = new I2PSocketAddress(dest, 1234);
assertThat(addr.toString(), is(equalTo(dest.calculateHash().toString() + ":1234")));
}
代码示例来源:origin: i2p/i2p.i2p
if (_log.shouldLog(Log.INFO)) {
_log.info(String.format("about to ping %s port %d from port %d timeout=%d blocking=%b",
peer.calculateHash().toString(), toPort, fromPort, timeoutMs, blocking));
代码示例来源:origin: i2p/i2p.i2p
if (!rv && log.shouldWarn()) {
log.warn("Cannot connect: " +
(usf ? "us" : from.toString()) + " with mask " + cf + "\nto " +
(ust ? "us" : to.toString()) + " with mask " + ct);
代码示例来源:origin: i2p/i2p.i2p
if (_log.shouldLog(Log.INFO)) {
_log.info(String.format("about to ping %s port %d from port %d timeout=%d payload=%d",
peer.calculateHash().toString(), toPort, fromPort, timeoutMs, payload.length));
代码示例来源:origin: i2p/i2p.i2p
_log.warn("NOT publishing to the peer after confirm plus delay (WITH banlist): " + (hash != null ? hash.toString() : "unknown"));
代码示例来源:origin: net.i2p.client/mstreaming
@Override
public String toString() {
StringBuilder buf = new StringBuilder();
if (_dest != null)
buf.append(_dest.calculateHash().toString());
else
buf.append(_host);
buf.append(':');
buf.append(_port);
return buf.toString();
}
代码示例来源:origin: i2p/i2p.i2p-bote
@Override
public int compare(Hash key1, Hash key2) {
return key1.toString().compareTo(key2.toString());
}
};
代码示例来源:origin: i2p/i2p.i2p
PeerState peer = getPeerState(to);
if (_log.shouldLog(Log.DEBUG))
_log.debug("Sending to " + (to != null ? to.toString() : ""));
if (peer != null) {
long lastSend = peer.getLastSendFullyTime();
代码示例来源:origin: net.i2p.client/streaming
if (_log.shouldLog(Log.INFO)) {
_log.info(String.format("about to ping %s port %d from port %d timeout=%d blocking=%b",
peer.calculateHash().toString(), toPort, fromPort, timeoutMs, blocking));
代码示例来源:origin: net.i2p.client/streaming
if (_log.shouldLog(Log.INFO)) {
_log.info(String.format("about to ping %s port %d from port %d timeout=%d payload=%d",
peer.calculateHash().toString(), toPort, fromPort, timeoutMs, payload.length));
内容来源于网络,如有侵权,请联系作者删除!