public abstract class Cell
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
CELL_PAYLOAD_SIZE |
static int |
CELL_SIZE |
private int |
m_circID |
private int |
m_command |
protected byte[] |
m_payload |
Modifier | Constructor and Description |
---|---|
protected |
Cell(int command) |
protected |
Cell(int command,
int circID) |
protected |
Cell(int command,
int circID,
byte[] payload) |
protected |
Cell(int command,
int circID,
byte[] payload,
int offset) |
Modifier and Type | Method and Description |
---|---|
static Cell |
createCell(byte[] cellData)
creates a cell with the given data
|
byte[] |
getCellData()
creates a fixed-sized cell
2 bytes - circID 1 byte - command 509 bytes - payload |
int |
getCircuitID()
gets the circuit id
|
int |
getCommand()
returns the command of the cell
|
byte[] |
getPayload()
gets the payload of the cell
|
void |
setPayload(byte[] payload,
int offset)
sets the payload
|
public static final int CELL_SIZE
public static final int CELL_PAYLOAD_SIZE
private int m_circID
private int m_command
protected byte[] m_payload
protected Cell(int command)
protected Cell(int command, int circID)
protected Cell(int command, int circID, byte[] payload)
protected Cell(int command, int circID, byte[] payload, int offset)
public byte[] getCellData()
public int getCommand()
public int getCircuitID()
public byte[] getPayload()
public void setPayload(byte[] payload, int offset)
payload
- payloadoffset
- offsetpublic static Cell createCell(byte[] cellData)
cellData
- dataCopyright © 2023. All rights reserved.