Package net.i2p.data
Class TunnelId
java.lang.Object
net.i2p.data.TunnelId
Defines the tunnel ID that messages are passed through on a set of routers.
This is not globally unique, but must be unique on each router making up
the tunnel (otherwise they would get confused and send messages down the
wrong one).
Note that a TunnelId must be greater than zero,
as the DatabaseStoreMessage uses a zero ID to request
a direct reply.
4 bytes, usually of random data.
Not recommended for external use, subject to change.
As of 0.9.48, does NOT extend DataStructureImpl, to save space
- Author:
- jrandom
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
long
int
hashCode()
void
readBytes
(InputStream in) void
setTunnelId
(long id) toString()
void
writeBytes
(OutputStream out)
-
Field Details
-
MAX_ID_VALUE
public static final long MAX_ID_VALUE- See Also:
-
-
Constructor Details
-
TunnelId
public TunnelId() -
TunnelId
public TunnelId(long id) - Parameters:
id
- 1 to 0xffffffff- Throws:
IllegalArgumentException
- if less than or equal to zero or greater than max value
-
-
Method Details
-
getTunnelId
public long getTunnelId() -
setTunnelId
public void setTunnelId(long id) - Parameters:
id
- 1 to 0xffffffff- Throws:
IllegalArgumentException
- if less than or equal to zero or greater than max value
-
readBytes
- Throws:
DataFormatException
IOException
-
writeBytes
- Throws:
DataFormatException
IOException
-
equals
-
hashCode
public int hashCode() -
toString
-