Class PcapWriter

java.lang.Object
io.netty.handler.pcap.PcapWriter
All Implemented Interfaces:
java.io.Closeable, java.lang.AutoCloseable

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

    Fields
    Modifier and Type
    Field
    Description
    private static final InternalLogger
    Logger
    private final java.io.OutputStream
    Reference declared so that we can use this as mutex in clean way.
    private final PcapWriteHandler
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    PcapWriter(PcapWriteHandler pcapWriteHandler)
    This uses OutputStream for writing Pcap data.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    java.lang.String
     
    (package private) void
    writePacket(ByteBuf packetHeaderBuf, ByteBuf packet)
    Write Packet in Pcap OutputStream.

    Methods inherited from class java.lang.Object

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

    • logger

      private static final InternalLogger logger
      Logger
    • pcapWriteHandler

      private final PcapWriteHandler pcapWriteHandler
    • outputStream

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

    • 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 Details

    • 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