public abstract class ArtNetPacket
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static byte[] |
ART_EXT_HEADER |
protected ByteUtils |
data |
static byte[] |
HEADER |
static java.util.logging.Logger |
logger |
static int |
PROTOCOL_VERSION |
protected PacketType |
type |
Constructor and Description |
---|
ArtNetPacket(PacketType type) |
Modifier and Type | Method and Description |
---|---|
byte[] |
getData() |
int |
getLength()
Returns the actually used length of the data buffer.
|
PacketType |
getType()
Returns the type of this packet.
|
abstract boolean |
parse(byte[] raw)
Parses the given byte array into semantic values and populates type
specific fields for each packet type.
|
void |
setData(byte[] data) |
void |
setData(byte[] raw,
int maxLength) |
protected void |
setHeader()
Sets the header bytes of the packet consisting of
HEADER and the
type's OpCode. |
protected void |
setProtocol() |
java.lang.String |
toString() |
public static final byte[] HEADER
public static final byte[] ART_EXT_HEADER
public static final int PROTOCOL_VERSION
public static final java.util.logging.Logger logger
protected ByteUtils data
protected final PacketType type
public ArtNetPacket(PacketType type)
public byte[] getData()
public int getLength()
public PacketType getType()
public abstract boolean parse(byte[] raw)
raw
- Raw data.public void setData(byte[] data)
data
- the data to setpublic void setData(byte[] raw, int maxLength)
protected void setHeader()
HEADER
and the
type's OpCode.protected void setProtocol()
public java.lang.String toString()
toString
in class java.lang.Object