T - the type of object the factory method returns.N - the type of object that is given to the factory method.public interface PacketFactory<T,N extends NamedNumber<?,?>>
| Modifier and Type | Method and Description |
|---|---|
T |
newInstance(byte[] rawData,
int offset,
int length,
N... numbers)
A factory method to build a packet or a packet field.
|
T newInstance(byte[] rawData, int offset, int length, N... numbers)
IllegalRawDataException. Instead, if an
IllegalRawDataException occurred during a packet dissection, this instantiates
IllegalRawDataPacket (if T is Packet) or IllegalRawDataHolder
(if T is not Packet) and returns it.rawData - a byte array including data this method will use for building a T instance.offset - offset of the data in the rawData.length - length of the data. The object to be returned is not required to use or represent
entire data. It means this length is not required to be exactly same as the
returning object's length, but is required to be not smaller than it.numbers - NamedNumber instances this method will refer to in order to decide
which concrete class to instantiate during building a T instance.Copyright © 2011 - 2018 Pcap4J.org. All rights reserved.