Class PcapHeaders

java.lang.Object
io.netty.handler.pcap.PcapHeaders

final class PcapHeaders extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final byte[]
    Pcap Global Header built from: magic_number version_major version_minor thiszone sigfigs snaplen network
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static void
    Writes the Pcap Global Header to the provided OutputStream
    (package private) static void
    writePacketHeader(ByteBuf byteBuf, int ts_sec, int ts_usec, int incl_len, int orig_len)
    Write Pcap Packet Header

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • PcapHeaders

      private PcapHeaders()
  • Method Details

    • writeGlobalHeader

      static void writeGlobalHeader(OutputStream outputStream) throws IOException
      Writes the Pcap Global Header to the provided OutputStream
      Parameters:
      outputStream - OutputStream where Pcap data will be written.
      Throws:
      IOException - if there is an error writing to the OutputStream
    • writePacketHeader

      static void writePacketHeader(ByteBuf byteBuf, int ts_sec, int ts_usec, int incl_len, int orig_len)
      Write Pcap Packet Header
      Parameters:
      byteBuf - ByteBuf where we'll write header data
      ts_sec - timestamp seconds
      ts_usec - timestamp microseconds
      incl_len - number of octets of packet saved in file
      orig_len - actual length of packet