net.floodlightcontroller.packet
Class Data

java.lang.Object
  extended by net.floodlightcontroller.packet.BasePacket
      extended by net.floodlightcontroller.packet.Data
All Implemented Interfaces:
IPacket

public class Data
extends BasePacket

Author:
David Erickson (daviderickson@cs.stanford.edu)

Field Summary
protected  byte[] data
           
 
Fields inherited from class net.floodlightcontroller.packet.BasePacket
log, parent, payload
 
Constructor Summary
Data()
           
Data(byte[] data)
           
 
Method Summary
 IPacket deserialize(byte[] data, int offset, int length)
          Deserializes this packet layer and all possible payloads
 boolean equals(java.lang.Object obj)
           
 byte[] getData()
           
 int hashCode()
           
 byte[] serialize()
          Sets all payloads parent packet if applicable, then serializes this packet and all payloads
 Data setData(byte[] data)
           
 
Methods inherited from class net.floodlightcontroller.packet.BasePacket
clone, getParent, getPayload, resetChecksum, setParent, setPayload
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

data

protected byte[] data
Constructor Detail

Data

public Data()

Data

public Data(byte[] data)
Parameters:
data -
Method Detail

getData

public byte[] getData()
Returns:
the data

setData

public Data setData(byte[] data)
Parameters:
data - the data to set

serialize

public byte[] serialize()
Description copied from interface: IPacket
Sets all payloads parent packet if applicable, then serializes this packet and all payloads

Returns:
a byte[] containing this packet and payloads

deserialize

public IPacket deserialize(byte[] data,
                           int offset,
                           int length)
Description copied from interface: IPacket
Deserializes this packet layer and all possible payloads

offset - offset to start deserializing from
length - length of the data to deserialize
Returns:
the deserialized data

hashCode

public int hashCode()
Overrides:
hashCode in class BasePacket

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class BasePacket