Class PacketBlock


  • public class PacketBlock
    extends java.lang.Object
    Single packet read from PCAP or PCAPNG.
    • Constructor Summary

      Constructors 
      Constructor Description
      PacketBlock​(long nanoseconds, byte[] data)
      Creates a new packet block with given timestamp and data.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] data()
      Byte array that contain the payload of this packet.
      long nanoseconds()
      Returns time in nanosecond precision.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PacketBlock

        public PacketBlock​(long nanoseconds,
                           byte[] data)
        Creates a new packet block with given timestamp and data.
        Parameters:
        nanoseconds - Timestamp.
        data - Data inside this packet.
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • data

        public byte[] data()
        Byte array that contain the payload of this packet.
        Returns:
        byte array
      • nanoseconds

        public long nanoseconds()
        Returns time in nanosecond precision. It is possible to return Lang.MIN_VALUE in case of simple packet block which does not contain timestamp.
        Returns:
        nanoseconds