udt.packets
Class DataPacket

java.lang.Object
  extended by udt.packets.DataPacket
All Implemented Interfaces:
Comparable<UDTPacket>, UDTPacket

public class DataPacket
extends Object
implements UDTPacket, Comparable<UDTPacket>


Constructor Summary
DataPacket()
           
DataPacket(byte[] encodedData)
          create a DataPacket
DataPacket(byte[] encodedData, int length)
           
 
Method Summary
 int compareTo(UDTPacket other)
           
 boolean forSender()
          return true if this packet should be routed to the UDTSender
 int getControlPacketType()
           
 byte[] getData()
           
 long getDestinationID()
           
 byte[] getEncoded()
          complete header+data packet for transmission
 byte[] getHeader()
          return the header according to specification p.5
 double getLength()
           
 long getMessageNumber()
           
 long getPacketSequenceNumber()
           
 UDTSession getSession()
           
 long getTimeStamp()
           
 boolean isConnectionHandshake()
           
 boolean isControlPacket()
           
 void setData(byte[] data)
           
 void setDestinationID(long destinationID)
           
 void setMessageNumber(long messageNumber)
           
 void setPacketSequenceNumber(long sequenceNumber)
           
 void setSession(UDTSession session)
           
 void setTimeStamp(long timeStamp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataPacket

public DataPacket()

DataPacket

public DataPacket(byte[] encodedData)
create a DataPacket

Parameters:
encodedData - - network data

DataPacket

public DataPacket(byte[] encodedData,
                  int length)
Method Detail

getData

public byte[] getData()

getLength

public double getLength()

setData

public void setData(byte[] data)

getPacketSequenceNumber

public long getPacketSequenceNumber()
Specified by:
getPacketSequenceNumber in interface UDTPacket

setPacketSequenceNumber

public void setPacketSequenceNumber(long sequenceNumber)

getMessageNumber

public long getMessageNumber()
Specified by:
getMessageNumber in interface UDTPacket

setMessageNumber

public void setMessageNumber(long messageNumber)
Specified by:
setMessageNumber in interface UDTPacket

getDestinationID

public long getDestinationID()
Specified by:
getDestinationID in interface UDTPacket

getTimeStamp

public long getTimeStamp()
Specified by:
getTimeStamp in interface UDTPacket

setDestinationID

public void setDestinationID(long destinationID)
Specified by:
setDestinationID in interface UDTPacket

setTimeStamp

public void setTimeStamp(long timeStamp)
Specified by:
setTimeStamp in interface UDTPacket

getHeader

public byte[] getHeader()
return the header according to specification p.5

Specified by:
getHeader in interface UDTPacket
Returns:

getEncoded

public byte[] getEncoded()
complete header+data packet for transmission

Specified by:
getEncoded in interface UDTPacket

isControlPacket

public boolean isControlPacket()
Specified by:
isControlPacket in interface UDTPacket

forSender

public boolean forSender()
Description copied from interface: UDTPacket
return true if this packet should be routed to the UDTSender

Specified by:
forSender in interface UDTPacket
Returns:

isConnectionHandshake

public boolean isConnectionHandshake()
Specified by:
isConnectionHandshake in interface UDTPacket

getControlPacketType

public int getControlPacketType()
Specified by:
getControlPacketType in interface UDTPacket

getSession

public UDTSession getSession()
Specified by:
getSession in interface UDTPacket

setSession

public void setSession(UDTSession session)

compareTo

public int compareTo(UDTPacket other)
Specified by:
compareTo in interface Comparable<UDTPacket>


Copyright © 2013 LittleShoot. All Rights Reserved.