Class PropertiesBasedSctpChunkFactory
java.lang.Object
org.pcap4j.packet.factory.propertiesbased.PropertiesBasedSctpChunkFactory
- All Implemented Interfaces:
PacketFactory<SctpPacket.SctpChunk,SctpChunkType>
public final class PropertiesBasedSctpChunkFactory
extends Object
implements PacketFactory<SctpPacket.SctpChunk,SctpChunkType>
- Since:
- pcap4j 1.6.6
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass<? extends SctpPacket.SctpChunk> Class<? extends SctpPacket.SctpChunk> getTargetClass(SctpChunkType number) newInstance(byte[] rawData, int offset, int length) newInstance(byte[] rawData, int offset, int length, Class<? extends SctpPacket.SctpChunk> dataClass) newInstance(byte[] rawData, int offset, int length, SctpChunkType number)
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
PropertiesBasedSctpChunkFactory
private PropertiesBasedSctpChunkFactory()
-
-
Method Details
-
getInstance
- Returns:
- the singleton instance of PropertiesBasedSctpChunkFactory.
-
newInstance
public SctpPacket.SctpChunk newInstance(byte[] rawData, int offset, int length, SctpChunkType number) - Specified by:
newInstancein interfacePacketFactory<SctpPacket.SctpChunk,SctpChunkType> - Parameters:
rawData- rawDataoffset- offsetlength- lengthnumber- number- Returns:
- a new data object.
-
newInstance
- Specified by:
newInstancein interfacePacketFactory<SctpPacket.SctpChunk,SctpChunkType> - Parameters:
rawData- rawDataoffset- offsetlength- length- Returns:
- a new data object.
-
newInstance
public SctpPacket.SctpChunk newInstance(byte[] rawData, int offset, int length, Class<? extends SctpPacket.SctpChunk> dataClass) - Parameters:
rawData- rawDataoffset- offsetlength- lengthdataClass- dataClass- Returns:
- a new SctpChunk 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<SctpPacket.SctpChunk,SctpChunkType> - Parameters:
number- number- Returns:
- a
Classobject this factory instantiates byPacketFactory.newInstance(byte[], int, int, NamedNumber)with the number argument.
-
getTargetClass
- Specified by:
getTargetClassin interfacePacketFactory<SctpPacket.SctpChunk,SctpChunkType> - Returns:
- a
Classobject this factory instantiates byPacketFactory.newInstance(byte[], int, int).
-