java.lang.Object
com.voytechs.jnetstream.codec.PacketImpl
- All Implemented Interfaces:
- MutablePacket, Packet
- public class PacketImpl
- extends java.lang.Object
- implements Packet, MutablePacket
| Fields inherited from interface com.voytechs.jnetstream.codec.Packet |
CAPTURE_DEVICE_ARCH, CAPTURE_DEVICE_FILENAME, CAPTURE_DEVICE_IP, CAPTURE_DEVICE_OS, CAPTURE_TIMESTAMP, FIRST_HEADER, PACKET_END, PACKET_LENGTH, PACKET_REMAINING, PACKET_SNAPLEN, PACKET_START |
debug
private static final boolean debug
- See Also:
- Constant Field Values
headerList
private java.util.ArrayList headerList
headerHash
private java.util.Hashtable headerHash
perm
private java.util.Hashtable perm
temp
private java.util.Hashtable temp
PacketImpl
public PacketImpl(java.util.Hashtable permProperties,
com.voytechs.jnetstream.io.PacketInputStream in)
setPacketPropertiesFromStream
protected void setPacketPropertiesFromStream(com.voytechs.jnetstream.io.PacketInputStream in)
setProperty
public void setProperty(java.lang.String name,
com.voytechs.jnetstream.primitive.Primitive property)
- Specified by:
setProperty in interface MutablePacket
getProperty
public com.voytechs.jnetstream.primitive.Primitive getProperty(java.lang.String name)
- Specified by:
getProperty in interface Packet
addHeader
public void addHeader(Header header)
- Adds a new header to the packet.
- Specified by:
addHeader in interface MutablePacket
getHeader
public Header getHeader(java.lang.String name)
- Returns the named header from the packet.
- Specified by:
getHeader in interface Packet
getHeader
public Header getHeader(int index)
- Returns the indexed header from the packet.
- Specified by:
getHeader in interface Packet
getHeaderCount
public int getHeaderCount()
- Returns the size of this packet. Size refers to number of headers
decoded. Only headers that this codec understands are decoded. There may
be additional undecoded headers of other protocoal still in the stack.
- Specified by:
getHeaderCount in interface Packet
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object
- Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method
never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string
concatenation with this object. If the result is
null, string concatenation will instead
use "null".
The default implementation returns
getClass().getName() + "@" +
Integer.toHexString(hashCode()).
main
public static void main(java.lang.String[] args)
- Test function for PacketImpl