public class Fragment extends BasePacket implements IExtensionHeader
Modifier and Type | Field and Description |
---|---|
protected short |
fragmentOffset |
static byte |
HEADER_LENGTH |
protected int |
identification |
protected byte |
moreFragment |
protected byte |
nextHeader |
parent, payload
Constructor and Description |
---|
Fragment() |
Modifier and Type | Method and Description |
---|---|
static Deserializer<Fragment> |
deserializer()
Deserializer function for fragment headers.
|
boolean |
equals(java.lang.Object obj) |
short |
getFragmentOffset()
Gets the fragment offset of this header.
|
int |
getIdentification()
Gets the identification of this header.
|
byte |
getMoreFragment()
Gets the more fragment flag of this header.
|
byte |
getNextHeader()
Gets the type of next header.
|
int |
hashCode() |
byte[] |
serialize()
Sets all payloads parent packet if applicable, then serializes this
packet and all payloads.
|
Fragment |
setFragmentOffset(short fragmentOffset)
Sets the fragment offset of this header.
|
Fragment |
setIdentification(int identification)
Sets the identification of this header.
|
Fragment |
setMoreFragment(byte moreFragment)
Sets the more fragment flag of this header.
|
Fragment |
setNextHeader(byte nextHeader)
Sets the type of next header.
|
java.lang.String |
toString() |
clone, getParent, getPayload, resetChecksum, setParent, setPayload
public static final byte HEADER_LENGTH
protected byte nextHeader
protected short fragmentOffset
protected byte moreFragment
protected int identification
public byte getNextHeader()
IExtensionHeader
getNextHeader
in interface IExtensionHeader
public Fragment setNextHeader(byte nextHeader)
IExtensionHeader
setNextHeader
in interface IExtensionHeader
nextHeader
- the next header to setpublic short getFragmentOffset()
public Fragment setFragmentOffset(short fragmentOffset)
fragmentOffset
- the fragment offset to setpublic byte getMoreFragment()
public Fragment setMoreFragment(byte moreFragment)
moreFragment
- the more fragment flag to setpublic int getIdentification()
public Fragment setIdentification(int identification)
identification
- the identification to setpublic byte[] serialize()
IPacket
public int hashCode()
hashCode
in class BasePacket
public boolean equals(java.lang.Object obj)
equals
in class BasePacket
public static Deserializer<Fragment> deserializer()
public java.lang.String toString()
toString
in class java.lang.Object