public final class CompressedPacket extends AbstractPacket
| Modifier and Type | Class and Description |
|---|---|
static class |
CompressedPacket.Builder |
AbstractPacket.AbstractBuilder, AbstractPacket.AbstractHeaderPacket.Header| Modifier and Type | Method and Description |
|---|---|
protected String |
buildString()
This method builds the value
toString() will return by
concatenating the header's string representation and the payload's string representation. |
protected int |
calcHashCode()
This method calculates the value
hashCode() will return using
the header's hash code and the payload's hash code. |
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
CompressedPacket.Builder |
getBuilder()
Returns a new Builder object populated with this object's fields' values.
|
byte[] |
getRawData()
Returns this packet's raw data.
|
int |
length()
Returns the packet length in bytes.
|
protected String |
modifier() |
static CompressedPacket |
newPacket(byte[] rawData,
int offset,
int length)
A static factory method.
|
buildHexString, buildRawData, calcLength, contains, get, getHeader, getOuterOf, getPayload, hashCode, iterator, toHexString, toStringpublic static CompressedPacket newPacket(byte[] rawData, int offset, int length)
ByteArrays.validateBounds(byte[], int, int),
which may throw exceptions undocumented here.rawData - rawDataoffset - offsetlength - lengthpublic CompressedPacket.Builder getBuilder()
PacketgetBuilder in interface PacketgetBuilder in class AbstractPacketprotected String modifier()
public int length()
AbstractPacketcalcLength() and caches the return value
when it is called for the first time,
and then, this method returns the cached value from the second time.length in interface Packetlength in class AbstractPacketpublic byte[] getRawData()
AbstractPacketbuildRawData() and caches the return value
when it is called for the first time,
and then, this method returns the cached value from the second time.
More correctly, this method returns a copy of the cached value,
so that the cache can't be changed.getRawData in interface PacketgetRawData in class AbstractPacketprotected String buildString()
AbstractPackettoString() will return by
concatenating the header's string representation and the payload's string representation.
If you write this subclass which represents a packet with extra parts (e.g. a trailer),
you need to override this method.buildString in class AbstractPacketpublic boolean equals(Object obj)
AbstractPacketequals in class AbstractPacketprotected int calcHashCode()
AbstractPackethashCode() will return using
the header's hash code and the payload's hash code.
If you write this subclass which represents a packet with extra parts (e.g. a trailer),
you need to override this method.calcHashCode in class AbstractPacketCopyright © 2011–2016 Pcap4J.org. All rights reserved.