net.sourceforge.jpcap.net
Class Packet

java.lang.Object
  extended bynet.sourceforge.jpcap.net.Packet
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
EthernetPacket

public class Packet
extends java.lang.Object
implements java.io.Serializable

A network packet.

This class currently contains no implementation because only ethernet is supported. In other words, all instances of packets returned by packet factory will always be at least as specific as EthernetPacket.

On large ethernet networks, I sometimes see packets which don't have link-level ethernet headers. If and when I figure out what these are, maybe this class will be the root node of a packet hierarchy derived from something other than ethernet.

See Also:
Serialized Form

Constructor Summary
Packet()
           
 
Method Summary
 java.lang.String getColor()
           
 byte[] getData()
          Fetch data portion of the packet.
 byte[] getHeader()
          Fetch data portion of the packet.
 java.lang.String toColoredString(boolean colored)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Packet

public Packet()
Method Detail

toColoredString

public java.lang.String toColoredString(boolean colored)

getHeader

public byte[] getHeader()
Fetch data portion of the packet.


getData

public byte[] getData()
Fetch data portion of the packet.


getColor

public java.lang.String getColor()