|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object aim4.msg.udp.UdpHeader
public class UdpHeader
Small header included in all UDP messages sent to/from the real car.
Nested Class Summary | |
---|---|
static class |
UdpHeader.UdpMessageType
The message type. |
Field Summary | |
---|---|
static int |
LENGTH
The size of a UDP header (in bytes) |
static int |
MAX_MESSENGE_PACKAGE_LENGTH
The maximum length of a message package including the header (in bytes) |
Constructor Summary | |
---|---|
UdpHeader(DataInputStream dis)
Construct the header given a DataInputStream wrapped around a DatagramPacket received over UDP from the real car. |
|
UdpHeader(float currentTime,
UdpHeader.UdpMessageType messageType)
Create a header for a particular message type |
Method Summary | |
---|---|
static int |
computeChecksum(byte[] data)
Compute the check sum for an array of bytes. |
int |
getChecksum()
Get the check sum. |
UdpHeader.UdpMessageType |
getMessageType()
Get the message type. |
float |
getTimestamp()
Get the time stamp. |
String |
toString()
|
DataOutputStream |
writeToDataOutputStream(DataOutputStream dos)
Write the data header to an I/O stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MAX_MESSENGE_PACKAGE_LENGTH
public static final int LENGTH
Constructor Detail |
---|
public UdpHeader(DataInputStream dis) throws IOException
dis
- The DataInputStream.
IOException
public UdpHeader(float currentTime, UdpHeader.UdpMessageType messageType)
currentTime
- the current timemessageType
- the message typeMethod Detail |
---|
public float getTimestamp()
public UdpHeader.UdpMessageType getMessageType()
public int getChecksum()
public DataOutputStream writeToDataOutputStream(DataOutputStream dos) throws IOException
dos
- the I/O stream
IOException
public static int computeChecksum(byte[] data)
data
- the array of bytes
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |