public class TunnelId extends Object
TunnelId provides unique identification within tunnel routing:
Constraints and Validation:
Usage in I2P:
Performance Considerations:
Security Aspects:
Implementation Notes:
Constants:
MAX_ID_VALUE - Maximum allowed tunnel ID (0xffffffff)| Modifier and Type | Field and Description |
|---|---|
static long | MAX_ID_VALUEMaximum tunnel ID value (2^32 - 1). |
| Constructor and Description |
|---|
TunnelId() |
TunnelId(long id)1 to 0xffffffff. |
| Modifier and Type | Method and Description |
|---|---|
boolean | equals(Object obj) |
long | getTunnelId()Tunnel ID. |
int | hashCode() |
void | readBytes(InputStream in)Read the tunnel ID from a stream. |
void | setTunnelId(long id)Sets the tunnel ID for this lease. |
String | toString() |
void | writeBytes(OutputStream out)Write the tunnel ID to a stream. |
public static final long MAX_ID_VALUE
public TunnelId()
public TunnelId(long id)
id - 1 to 0xffffffffIllegalArgumentException - if less than or equal to zero or greater than max valuepublic long getTunnelId()
public void readBytes(InputStream in) throws DataFormatException, IOException
in - the input stream to read fromDataFormatException - if the data is invalidIOException - if there is an error readingpublic final void setTunnelId(long id)
id - 1 to 0xffffffffIllegalArgumentException - if less than or equal to zero or greater than max valuepublic void writeBytes(OutputStream out) throws DataFormatException, IOException
out - the output stream to write toDataFormatException - if the data is invalidIOException - if there is an error writing