Package jpcap

Class JpcapWriter

java.lang.Object
jpcap.JpcapWriter

public class JpcapWriter extends Object
This class is used to save the captured packets into a file.
  • Method Details

    • openDumpFile

      public static JpcapWriter openDumpFile(JpcapCaptor jpcap, String filename) throws IOException
      Opens a file to save the captured packets.
      Parameters:
      jpcap - instance of JpcapCaptor that was used to capture (load) packets
      filename - filename
      Throws:
      IOException - If the file cannot be opened
      IOException
    • close

      public void close()
      Closes the opened file.
    • writePacket

      public void writePacket(Packet packet)
      Saves a packet into the file.
      Parameters:
      packet - Packet to be saved