cnrg.itx.datax.devices
Class RTPPacket

java.lang.Object
  |
  +--cnrg.itx.datax.devices.RTPPacket

class RTPPacket
extends java.lang.Object

Class to represent an RTP packet. This will contain the RTP header and the audio data byte array.


Field Summary
private  byte[] data
          Attribute to store the audio data as a byte array.
private  RTPHeader header
          Attribute to store the RTP header for the packet.
 
Constructor Summary
RTPPacket()
          Default constructor for an RTP packet.
RTPPacket(byte[] rtpData)
          Constructor for making a RTP packet out of a byte array that represents a RTP packet.
RTPPacket(RTPHeader header, byte[] data)
          Constructor for making an RTP packet from its constituents.
 
Method Summary
 byte[] getData()
          Accessor for the audio data byte array.
 RTPHeader getRTPHeader()
          Accessor for the RTP header.
 void setData(byte[] data)
          Mutator for the audio data byte array.
 void setRTPHeader(RTPHeader header)
          Mutator for the RTP header.
 byte[] toByteArray()
          Method to get the byte array form of an RTP packet.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

header

private RTPHeader header
Attribute to store the RTP header for the packet.

data

private byte[] data
Attribute to store the audio data as a byte array.
Constructor Detail

RTPPacket

public RTPPacket()
Default constructor for an RTP packet.

RTPPacket

public RTPPacket(RTPHeader header,
                 byte[] data)
Constructor for making an RTP packet from its constituents.
Parameters:
header - the RTP header for this packet
data - the byte array containing the audio data

RTPPacket

public RTPPacket(byte[] rtpData)
Constructor for making a RTP packet out of a byte array that represents a RTP packet.
Parameters:
rtpData - the array of bytes representing a RTP packet
Method Detail

getRTPHeader

public RTPHeader getRTPHeader()
Accessor for the RTP header.
Returns:
RTPHeader the RTP header for this packet

setRTPHeader

public void setRTPHeader(RTPHeader header)
Mutator for the RTP header.
Parameters:
RTPHeader - the new RTP header for this packet

getData

public byte[] getData()
Accessor for the audio data byte array.
Returns:
byte[] the array of audio data bytes

setData

public void setData(byte[] data)
Mutator for the audio data byte array.
Parameters:
byte[] - the array of audio data bytes

toByteArray

public byte[] toByteArray()
Method to get the byte array form of an RTP packet.
Returns:
byte[] the byte array of the RTP packet