public final class IllegalPacket extends AbstractPacket implements IllegalRawDataPacket
| Modifier and Type | Class and Description |
|---|---|
static class |
IllegalPacket.Builder |
AbstractPacket.AbstractBuilder, AbstractPacket.AbstractHeaderPacket.Header| Modifier and Type | Method and Description |
|---|---|
protected java.lang.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(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.
|
IllegalPacket.Builder |
getBuilder()
Returns a new Builder object populated with this object's fields' values.
|
IllegalRawDataException |
getCause() |
byte[] |
getRawData()
Returns this packet's raw data.
|
int |
length()
Returns the packet length in bytes.
|
static IllegalPacket |
newPacket(byte[] rawData,
int offset,
int length,
IllegalRawDataException cause)
A static factory method.
|
buildHexString, buildRawData, calcLength, getHeader, getPayload, hashCode, toHexString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitcontains, get, getHeader, getOuterOf, getPayload, iteratorpublic static IllegalPacket newPacket(byte[] rawData, int offset, int length, IllegalRawDataException cause)
ByteArrays.validateBounds(byte[], int, int),
which may throw exceptions undocumented here.rawData - rawDataoffset - offsetlength - lengthcause - causepublic 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 IllegalRawDataHoldergetRawData in interface PacketgetRawData in class AbstractPacketpublic IllegalRawDataException getCause()
getCause in interface IllegalRawDataHolderpublic IllegalPacket.Builder getBuilder()
PacketgetBuilder in interface PacketgetBuilder in class AbstractPacketprotected java.lang.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(java.lang.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 - 2018 Pcap4J.org. All rights reserved.