Class PropertiesBasedTcpOptionFactory
java.lang.Object
org.pcap4j.packet.factory.propertiesbased.PropertiesBasedTcpOptionFactory
- All Implemented Interfaces:
PacketFactory<TcpPacket.TcpOption, TcpOptionKind>
public final class PropertiesBasedTcpOptionFactory
extends Object
implements PacketFactory<TcpPacket.TcpOption, TcpOptionKind>
- Since:
- pcap4j 0.9.14
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass<? extends TcpPacket.TcpOption> Class<? extends TcpPacket.TcpOption> getTargetClass(TcpOptionKind number) newInstance(byte[] rawData, int offset, int length) newInstance(byte[] rawData, int offset, int length, Class<? extends TcpPacket.TcpOption> dataClass) newInstance(byte[] rawData, int offset, int length, TcpOptionKind number)
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
PropertiesBasedTcpOptionFactory
private PropertiesBasedTcpOptionFactory()
-
-
Method Details
-
getInstance
- Returns:
- the singleton instance of PropertiesBasedTcpOptionFactory.
-
newInstance
public TcpPacket.TcpOption newInstance(byte[] rawData, int offset, int length, TcpOptionKind number) - Specified by:
newInstancein interfacePacketFactory<TcpPacket.TcpOption, TcpOptionKind>- Parameters:
rawData- rawDataoffset- offsetlength- lengthnumber- number- Returns:
- a new data object.
-
newInstance
- Specified by:
newInstancein interfacePacketFactory<TcpPacket.TcpOption, TcpOptionKind>- Parameters:
rawData- rawDataoffset- offsetlength- length- Returns:
- a new data object.
-
newInstance
public TcpPacket.TcpOption newInstance(byte[] rawData, int offset, int length, Class<? extends TcpPacket.TcpOption> dataClass) - Parameters:
rawData- rawDataoffset- offsetlength- lengthdataClass- dataClass- Returns:
- a new TcpOption object.
- Throws:
IllegalStateException- if an access to the newInstance method of the dataClass fails.IllegalArgumentException- if an exception other thanIllegalRawDataExceptionis thrown by newInstance method of the dataClass.NullPointerException- if any of arguments are null.
-
getTargetClass
- Specified by:
getTargetClassin interfacePacketFactory<TcpPacket.TcpOption, TcpOptionKind>- Parameters:
number- number- Returns:
- a
Classobject this factory instantiates byPacketFactory.newInstance(byte[], int, int, NamedNumber)with the number argument.
-
getTargetClass
- Specified by:
getTargetClassin interfacePacketFactory<TcpPacket.TcpOption, TcpOptionKind>- Returns:
- a
Classobject this factory instantiates byPacketFactory.newInstance(byte[], int, int).
-