net.sourceforge.jpcap.net
Class PacketEncoding
java.lang.Object
|
+--net.sourceforge.jpcap.net.PacketEncoding
- public class PacketEncoding
- extends java.lang.Object
Packet encoding.
Contains utility methods for decoding generic packets.
Method Summary |
static byte[] |
extractData(int offset,
int headerLen,
byte[] bytes)
Extract data from a packet. |
static byte[] |
extractHeader(int offset,
int headerLen,
byte[] bytes)
Extract a header from a packet. |
static void |
main(java.lang.String[] args)
Unit test. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PacketEncoding
public PacketEncoding()
extractHeader
public static byte[] extractHeader(int offset,
int headerLen,
byte[] bytes)
- Extract a header from a packet.
- Parameters:
offset
- the offset in bytes to the start of the embedded header.headerLen
- the length of the header embedded in the packet.bytes
- the packet data, including the embedded header and data.- Returns:
- the extracted header data.
extractData
public static byte[] extractData(int offset,
int headerLen,
byte[] bytes)
- Extract data from a packet.
- Parameters:
offset
- the offset in bytes to the start of the embedded header.headerLen
- the length of the header embedded in the packet.bytes
- the packet data, including the embedded header and data.- Returns:
- the extracted packet data.
main
public static void main(java.lang.String[] args)
- Unit test.