public final class EncryptedPacket extends AbstractPacket
Modifier and Type | Class and Description |
---|---|
static class |
EncryptedPacket.Builder |
AbstractPacket.AbstractBuilder, AbstractPacket.AbstractHeader
Packet.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.
|
EncryptedPacket.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 EncryptedPacket |
newPacket(byte[] rawData,
int offset,
int length)
A static factory method.
|
buildHexString, buildRawData, calcLength, contains, get, getHeader, getOuterOf, getPayload, hashCode, iterator, toHexString, toString
public static EncryptedPacket newPacket(byte[] rawData, int offset, int length)
ByteArrays.validateBounds(byte[], int, int)
,
which may throw exceptions undocumented here.rawData
- rawDataoffset
- offsetlength
- lengthpublic EncryptedPacket.Builder getBuilder()
Packet
getBuilder
in interface Packet
getBuilder
in class AbstractPacket
protected String modifier()
public int length()
AbstractPacket
calcLength()
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 Packet
length
in class AbstractPacket
public byte[] getRawData()
AbstractPacket
buildRawData()
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 Packet
getRawData
in class AbstractPacket
protected String buildString()
AbstractPacket
toString()
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 AbstractPacket
public boolean equals(Object obj)
AbstractPacket
equals
in class AbstractPacket
protected int calcHashCode()
AbstractPacket
hashCode()
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 AbstractPacket
Copyright © 2011–2016 Pcap4J.org. All rights reserved.