Package org.pcap4j.core
Class PcapDumper
- java.lang.Object
-
- org.pcap4j.core.PcapDumper
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public final class PcapDumper extends java.lang.Object implements java.lang.AutoCloseable
- Since:
- pcap4j 0.9.9
- Author:
- Kaito Yamada
-
-
Method Summary
Modifier and Type Method Description void
close()
Closes this PcapDumper.void
dump(PcapPacket packet)
void
dump(Packet packet)
void
dump(Packet packet, java.time.Instant timestamp)
void
dumpRaw(byte[] packet)
void
dumpRaw(byte[] packet, java.time.Instant timestamp)
void
flush()
long
ftell()
boolean
isOpen()
-
-
-
Method Detail
-
isOpen
public boolean isOpen()
- Returns:
- true if this PcapDumper is open; false otherwise.
-
dump
public void dump(Packet packet) throws NotOpenException
- Parameters:
packet
- packet- Throws:
NotOpenException
- if this PcapHandle is not open.
-
dump
public void dump(PcapPacket packet) throws NotOpenException
- Parameters:
packet
- packet- Throws:
NotOpenException
- if this PcapHandle is not open.
-
dump
public void dump(Packet packet, java.time.Instant timestamp) throws NotOpenException
- Parameters:
packet
- packettimestamp
- timestamp- Throws:
NotOpenException
- if this PcapHandle is not open.
-
dumpRaw
public void dumpRaw(byte[] packet) throws NotOpenException
- Parameters:
packet
- packet- Throws:
NotOpenException
- if this PcapHandle is not open.
-
dumpRaw
public void dumpRaw(byte[] packet, java.time.Instant timestamp) throws NotOpenException
- Parameters:
packet
- packettimestamp
- timestamp- Throws:
NotOpenException
- if this PcapHandle is not open.
-
flush
public void flush() throws PcapNativeException, NotOpenException
- Throws:
PcapNativeException
- if an error occurs in the pcap native library.NotOpenException
- if this PcapHandle is not open.
-
ftell
public long ftell() throws PcapNativeException, NotOpenException
- Returns:
- the file position for a "savefile".
- Throws:
PcapNativeException
- if an error occurs in the pcap native library.NotOpenException
- if this PcapHandle is not open.
-
close
public void close()
Closes this PcapDumper.- Specified by:
close
in interfacejava.lang.AutoCloseable
-
-