public class BSN extends BasePacket
Modifier and Type | Field and Description |
---|---|
static int |
BSN_MAGIC |
static short |
BSN_TYPE_BDDP |
static short |
BSN_TYPE_PROBE |
static short |
BSN_VERSION_CURRENT |
protected short |
type |
static java.util.Map<java.lang.Short,java.lang.Class<? extends IPacket>> |
typeClassMap |
protected short |
version |
parent, payload
Modifier and Type | Method and Description |
---|---|
IPacket |
deserialize(byte[] data,
int offset,
int length)
Deserializes this packet layer and all possible payloads
|
boolean |
equals(java.lang.Object obj) |
short |
getType() |
short |
getVersion() |
int |
hashCode() |
byte[] |
serialize()
Sets all payloads parent packet if applicable, then serializes this
packet and all payloads
|
BSN |
setType(short type) |
BSN |
setVersion(short version) |
java.lang.String |
toString() |
clone, getParent, getPayload, resetChecksum, setParent, setPayload
public static final int BSN_MAGIC
public static final short BSN_VERSION_CURRENT
public static final short BSN_TYPE_PROBE
public static final short BSN_TYPE_BDDP
public static java.util.Map<java.lang.Short,java.lang.Class<? extends IPacket>> typeClassMap
protected short type
protected short version
public short getType()
public BSN setType(short type)
public short getVersion()
public BSN setVersion(short version)
public byte[] serialize()
IPacket
public IPacket deserialize(byte[] data, int offset, int length)
IPacket
offset
- offset to start deserializing fromlength
- length of the data to deserializepublic int hashCode()
hashCode
in class BasePacket
public boolean equals(java.lang.Object obj)
equals
in class BasePacket
public java.lang.String toString()
toString
in class java.lang.Object