Package jpcap
Class JpcapWriter
- java.lang.Object
-
- jpcap.JpcapWriter
-
public class JpcapWriter extends java.lang.Object
This class is used to save the captured packets into a file.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the opened file.static JpcapWriter
openDumpFile(JpcapCaptor jpcap, java.lang.String filename)
Opens a file to save the captured packets.void
writePacket(Packet packet)
Saves a packet into the 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) packetsfilename
- 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
-
-