Package jpcap

Class JpcapWriter


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

      • openDumpFile

        public static JpcapWriter openDumpFile​(JpcapCaptor jpcap,
                                               java.lang.String filename)
                                        throws java.io.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
      • 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