com.enderak.procol.common.net
Class ProColPacket

java.lang.Object
  |
  +--com.enderak.procol.common.net.ProColPacket

public class ProColPacket
extends java.lang.Object

Represents a ProCol packet that is sent over the network connection

Author:
Justin Dieters

Field Summary
 byte[] data
          Data section of this packet
 int dataRemaining
          Data remaining in this message
 int dataSize
          Data size of this message
 int messageID
          The message id this packet is a part of
 int requestCode
          Request code for this message
 
Constructor Summary
ProColPacket(int messageIDIn, int requestCodeIn, int dataRemainingIn, int dataSizeIn, byte[] dataIn)
          Creates a packet from existing data
 
Method Summary
 void setPacket(int messageIDIn, int requestCodeIn, int dataRemainingIn, int dataSizeIn, byte[] dataIn)
          Redefines this packet from existing data
 java.lang.String toString()
          Prints this packet's information
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

messageID

public int messageID
The message id this packet is a part of


dataRemaining

public int dataRemaining
Data remaining in this message


requestCode

public int requestCode
Request code for this message


dataSize

public int dataSize
Data size of this message


data

public byte[] data
Data section of this packet

Constructor Detail

ProColPacket

public ProColPacket(int messageIDIn,
                    int requestCodeIn,
                    int dataRemainingIn,
                    int dataSizeIn,
                    byte[] dataIn)
Creates a packet from existing data

Parameters:
messageIDIn - The the message ID this packet is a part of
requestCodeIn - The request code for this packet
dataRemainingIn - The number of bytes remaining in the message, including this packet's data
dataSizeIn - The size of the data section of this packet
dataIn - The bytes that make upthe data section of this packet
Method Detail

setPacket

public void setPacket(int messageIDIn,
                      int requestCodeIn,
                      int dataRemainingIn,
                      int dataSizeIn,
                      byte[] dataIn)
Redefines this packet from existing data

Parameters:
messageIDIn - The the message ID this packet is a part of
requestCodeIn - The request code for this packet
dataRemainingIn - The number of bytes remaining in the message, including this packet's data
dataSizeIn - The size of the data section of this packet
dataIn - The bytes that make upthe data section of this packet

toString

public java.lang.String toString()
Prints this packet's information

Overrides:
toString in class java.lang.Object
Returns:
This packet's data as a string