org.irig106.chapter10
Class Packet

java.lang.Object
  extended by org.irig106.chapter10.Packet

public class Packet
extends java.lang.Object

IRIG 106 Chapter 10 Packet Class

This class encapsulates the generic IRIG 106 Chapter 10 Packet. It contains packet header information and the raw packet body data. Based on header information, it also provides references to classes encapsulating the packet body

In the future - possible plans include to make this a reference-implementation of a more abstract IRIG Chapter 10 API

Author:
David Pinto

Nested Class Summary
static class Packet.PacketType
          Packet-Type Definitions
 
Constructor Summary
Packet()
          Creates a new packet with no data
Packet(java.io.InputStream is)
          Create a new packet and populates the data (header + body info)
 
Method Summary
 PacketHeader getHeader()
          Returns Packet's Header
 java.lang.Object getPacketBody()
          Returns a packet as defined by the DataType
 byte[] getPacketBodyData()
          Returns the block of bytes that make up the "packet body data" as defined in Chapter 10
 void read(java.io.InputStream is)
          Sets packet header and data (assumes stream is at frame-sync position)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Packet

public Packet()
Creates a new packet with no data


Packet

public Packet(java.io.InputStream is)
       throws java.lang.Exception
Create a new packet and populates the data (header + body info)

Throws:
java.lang.Exception
Method Detail

read

public void read(java.io.InputStream is)
          throws java.lang.Exception
Sets packet header and data (assumes stream is at frame-sync position)

Throws:
java.lang.Exception

getHeader

public PacketHeader getHeader()
Returns Packet's Header


getPacketBody

public java.lang.Object getPacketBody()
                               throws java.lang.Exception

Returns a packet as defined by the DataType

An exception will be throws if no type is currently defined. Defined types currently include:

Throws:
java.lang.Exception

getPacketBodyData

public byte[] getPacketBodyData()
Returns the block of bytes that make up the "packet body data" as defined in Chapter 10