Class PcapWriter

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    final class PcapWriter
    extends java.lang.Object
    implements java.io.Closeable
    • Field Detail

      • outputStream

        private final java.io.OutputStream outputStream
        Reference declared so that we can use this as mutex in clean way.
    • Constructor Detail

      • PcapWriter

        PcapWriter​(PcapWriteHandler pcapWriteHandler)
            throws java.io.IOException
        This uses OutputStream for writing Pcap data.
        Throws:
        java.io.IOException - If OutputStream.write(byte[]) throws an exception
    • Method Detail

      • writePacket

        void writePacket​(ByteBuf packetHeaderBuf,
                         ByteBuf packet)
                  throws java.io.IOException
        Write Packet in Pcap OutputStream.
        Parameters:
        packetHeaderBuf - Packer Header ByteBuf
        packet - Packet
        Throws:
        java.io.IOException - If OutputStream.write(byte[]) throws an exception
      • toString

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

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Throws:
        java.io.IOException