jpcap
Class JpcapWriter

java.lang.Object
  extended by jpcap.JpcapWriter

public class JpcapWriter
extends java.lang.Object

This class is used to save the captured packets into a file.


Method Summary
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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