amber.type.server
Class PacketData

java.lang.Object
  |
  +--amber.type.server.PacketData

public class PacketData
extends java.lang.Object

This class contains a packet which is transmitted by the client. It holds both the original packet and the data decoders used to extract the information from it.

Version:
1.0.0
Author:
Dr. David J. Knowles
See Also:
ComponentHandler

Field Summary
protected  java.io.ByteArrayInputStream byteData
          This is the stream which reads the binary data.
protected  AmberInputStream dataDecoder
          This is the normal data reader stream which is used by classes to extract meaningful data from the packet.
protected  Packet packet
          This is the actual packet itself
 
Constructor Summary
PacketData()
          Default Constructor.
PacketData(Packet packet)
          Initialising Constructor.
PacketData(Packet packet, java.io.ByteArrayInputStream byteData, AmberInputStream dataDecoder)
          Initialising Constructor.
 
Method Summary
 java.io.ByteArrayInputStream getByteData()
          Gets the data in the following variable: This is the stream which reads the binary data.
 AmberInputStream getDataDecoder()
          Gets the data in the following variable: This is the normal data reader stream which is used by classes to extract meaningful data from the packet.
 Packet getPacket()
          Gets the data in the following variable: This is the actual packet itself
 void setByteData(java.io.ByteArrayInputStream data)
          Sets the data in the following variable: This is the stream which reads the binary data.
 void setDataDecoder(AmberInputStream data)
          Sets the data in the following variable: This is the normal data reader stream which is used by classes to extract meaningful data from the packet.
 void setPacket(Packet data)
          Sets the data in the following variable: This is the actual packet itself
 java.lang.String toString()
          This function returns the String form of the data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

packet

protected Packet packet
This is the actual packet itself

byteData

protected java.io.ByteArrayInputStream byteData
This is the stream which reads the binary data.

dataDecoder

protected AmberInputStream dataDecoder
This is the normal data reader stream which is used by classes to extract meaningful data from the packet.
Constructor Detail

PacketData

public PacketData()
Default Constructor.

PacketData

public PacketData(Packet packet,
                  java.io.ByteArrayInputStream byteData,
                  AmberInputStream dataDecoder)
Initialising Constructor.
Parameters:
packet - This is the actual packet itself
byteData - This is the stream which reads the binary data.
dataDecoder - This is the normal data reader stream which is used by classes to extract meaningful data from the packet.

PacketData

public PacketData(Packet packet)
Initialising Constructor. This constructor takes the input packet and generates the internal streams from it.
Parameters:
packet - This is the actual packet itself
Method Detail

getPacket

public Packet getPacket()
Gets the data in the following variable: This is the actual packet itself
Returns:
Packet containing the required information.

getByteData

public java.io.ByteArrayInputStream getByteData()
Gets the data in the following variable: This is the stream which reads the binary data.
Returns:
ByteArrayInputStream containing the required information.

getDataDecoder

public AmberInputStream getDataDecoder()
Gets the data in the following variable: This is the normal data reader stream which is used by classes to extract meaningful data from the packet.
Returns:
AmberInputStream containing the required information.

setPacket

public void setPacket(Packet data)
Sets the data in the following variable: This is the actual packet itself
Parameters:
data - Packet containing the data to set the variable to.

setByteData

public void setByteData(java.io.ByteArrayInputStream data)
Sets the data in the following variable: This is the stream which reads the binary data.
Parameters:
data - ByteArrayInputStream containing the data to set the variable to.

setDataDecoder

public void setDataDecoder(AmberInputStream data)
Sets the data in the following variable: This is the normal data reader stream which is used by classes to extract meaningful data from the packet.
Parameters:
data - AmberInputStream containing the data to set the variable to.

toString

public java.lang.String toString()
This function returns the String form of the data.
Overrides:
toString in class java.lang.Object
Returns:
String containing the string version of this class.


Copyright © 2002 Clearfield Research Ltd. All Rights Reserved.