public interface Cell
| Modifier and Type | Field and Description |
|---|---|
static int |
ADDRESS_TYPE_HOSTNAME |
static int |
ADDRESS_TYPE_IPV4 |
static int |
ADRESS_TYPE_IPV6 |
static int |
AUTH_CHALLENGE |
static int |
AUTHENTICATE |
static int |
AUTHORIZE |
static int |
CELL_HEADER_LEN
The length of a standard cell header.
|
static int |
CELL_LEN
The fixed size of a standard cell.
|
static int |
CELL_PAYLOAD_LEN
The length of the payload space in a standard cell.
|
static int |
CELL_VAR_HEADER_LEN
The header length for a variable length cell (ie: VERSIONS)
|
static int |
CERTS |
static int |
CREATE
Command constant for a CREATE type cell.
|
static int |
CREATE_FAST
Command constant for a CREATE_FAST type cell.
|
static int |
CREATED
Command constant for a CREATED type cell.
|
static int |
CREATED_FAST
Command constant for a CREATED_FAST type cell.
|
static int |
DESTROY
Command constant for a DESTROY type cell.
|
static int |
ERROR_CONNECTFAILED |
static int |
ERROR_DESTROYED |
static int |
ERROR_FINISHED |
static int |
ERROR_HIBERNATING |
static int |
ERROR_INTERNAL |
static int |
ERROR_NONE |
static int |
ERROR_NOSUCHSERVICE |
static int |
ERROR_OR_CONN_CLOSED |
static int |
ERROR_OR_IDENTITY |
static int |
ERROR_PROTOCOL |
static int |
ERROR_REQUESTED |
static int |
ERROR_RESOURCELIMIT |
static int |
ERROR_TIMEOUT |
static int |
NETINFO
Command constant for a NETINFO type cell.
|
static int |
PADDING
Command constant for a PADDING type cell.
|
static int |
RELAY
Command constant for a RELAY type cell.
|
static int |
RELAY_EARLY
Command constant for a RELAY_EARLY type cell.
|
static int |
VERSIONS
Command constant for a VERSIONS type cell.
|
static int |
VPADDING |
| Modifier and Type | Method and Description |
|---|---|
int |
cellBytesConsumed()
Return the number of bytes already packed (for outgoing cells) or unpacked (for incoming cells).
|
int |
cellBytesRemaining()
Return the number of bytes remaining between the current internal pointer and the end of the cell.
|
int |
getByte()
Return the next byte from the cell and increment the internal pointer by one byte.
|
void |
getByteArray(byte[] buffer)
Copy
buffer.length bytes from the cell into buffer. |
int |
getByteAt(int index)
Return the byte at the specified offset into the cell.
|
byte[] |
getCellBytes()
Return the entire cell data as a raw array of bytes.
|
int |
getCircuitId()
Return the circuit id field from this cell.
|
int |
getCommand()
Return the command field from this cell.
|
int |
getInt()
Return the next 32-bit big endian value from the cell and increment the internal pointer by four bytes.
|
int |
getShort()
Return the next 16-bit big endian value from the cell and increment the internal pointer by two bytes.
|
int |
getShortAt(int index)
Return the 16-bit big endian value at the specified offset into the cell.
|
void |
putByte(int value)
Store a byte at the current pointer location and increment the pointer by one byte.
|
void |
putByteArray(byte[] data)
Store the entire array
data at the current pointer location and increment
the pointer by data.length bytes. |
void |
putByteArray(byte[] data,
int offset,
int length)
Store
length bytes of the byte array data starting from
offset into the array at the current pointer location and increment
the pointer by length bytes. |
void |
putByteAt(int index,
int value)
Store a byte at the specified offset into the cell.
|
void |
putInt(int value)
Store a 32-bit integer value in big endian order at the current pointer location and
increment the pointer by 4 bytes.
|
void |
putShort(int value)
Store a 16-bit short value in big endian order at the current pointer location and
increment the pointer by two bytes.
|
void |
putShortAt(int index,
int value)
Store a 16-bit short value in big endian byte order at the specified offset into the cell
and increment the pointer by two bytes.
|
void |
putString(String string) |
void |
resetToPayload()
Set the internal pointer to the first byte after the cell header.
|
static final int PADDING
static final int CREATE
static final int CREATED
static final int RELAY
static final int DESTROY
static final int CREATE_FAST
static final int CREATED_FAST
static final int VERSIONS
static final int NETINFO
static final int RELAY_EARLY
static final int VPADDING
static final int CERTS
static final int AUTH_CHALLENGE
static final int AUTHENTICATE
static final int AUTHORIZE
static final int ERROR_NONE
static final int ERROR_PROTOCOL
static final int ERROR_INTERNAL
static final int ERROR_REQUESTED
static final int ERROR_HIBERNATING
static final int ERROR_RESOURCELIMIT
static final int ERROR_CONNECTFAILED
static final int ERROR_OR_IDENTITY
static final int ERROR_OR_CONN_CLOSED
static final int ERROR_FINISHED
static final int ERROR_TIMEOUT
static final int ERROR_DESTROYED
static final int ERROR_NOSUCHSERVICE
static final int ADDRESS_TYPE_HOSTNAME
static final int ADDRESS_TYPE_IPV4
static final int ADRESS_TYPE_IPV6
static final int CELL_LEN
static final int CELL_HEADER_LEN
static final int CELL_VAR_HEADER_LEN
static final int CELL_PAYLOAD_LEN
int getCircuitId()
int getCommand()
void resetToPayload()
int getByte()
int getByteAt(int index)
index - The cell offset.int getShort()
int getShortAt(int index)
index - The cell offset.int getInt()
void getByteArray(byte[] buffer)
buffer.length bytes from the cell into buffer. The data is copied starting
from the current internal pointer location and afterwards the internal pointer is incremented by buffer.length
bytes.buffer - The array of bytes to copy the cell data into.int cellBytesConsumed()
int cellBytesRemaining()
void putByte(int value)
value - The byte value to store.void putByteAt(int index,
int value)
index - The offset in bytes into the cell.value - The byte value to store.void putShort(int value)
value - The 16-bit short value to store.void putShortAt(int index,
int value)
index - The offset in bytes into the cell.value - The 16-bit short value to store.void putInt(int value)
value - The 32-bit integer value to store.void putByteArray(byte[] data)
data at the current pointer location and increment
the pointer by data.length bytes.data - The array of bytes to store in the cell.void putByteArray(byte[] data,
int offset,
int length)
length bytes of the byte array data starting from
offset into the array at the current pointer location and increment
the pointer by length bytes.data - The source array of bytes.offset - The offset into the source array.length - The number of bytes from the source array to store.byte[] getCellBytes()
VERSIONS, this array will be exactly CELL_LEN bytes long.void putString(String string)
Copyright © 2015. All rights reserved.