Package jpcap
Class JpcapWriter
java.lang.Object
jpcap.JpcapWriter
This class is used to save the captured packets into a file.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Closes the opened file.static JpcapWriter
openDumpFile
(JpcapCaptor jpcap, String filename) Opens a file to save the captured packets.void
writePacket
(Packet packet) Saves a packet into the file.
-
Method Details
-
openDumpFile
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 openedIOException
-
close
public void close()Closes the opened file. -
writePacket
Saves a packet into the file.- Parameters:
packet
- Packet to be saved
-