Package io.netty.handler.pcap
Class PcapWriter
- java.lang.Object
-
- io.netty.handler.pcap.PcapWriter
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
final class PcapWriter extends java.lang.Object implements java.io.Closeable
-
-
Field Summary
Fields Modifier and Type Field Description private booleanisClosedSet totrueifoutputStreamis closed.private static InternalLoggerloggerLoggerprivate java.io.OutputStreamoutputStreamOutputStreamwhere we'll write Pcap data.
-
Constructor Summary
Constructors Constructor Description PcapWriter(java.io.OutputStream outputStream)This usesOutputStreamfor writing Pcap.PcapWriter(java.io.OutputStream outputStream, ByteBuf byteBuf)This usesOutputStreamfor writing Pcap.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()(package private) voidwritePacket(ByteBuf packetHeaderBuf, ByteBuf packet)Write Packet in Pcap OutputStream.
-
-
-
Field Detail
-
logger
private static final InternalLogger logger
Logger
-
outputStream
private final java.io.OutputStream outputStream
OutputStreamwhere we'll write Pcap data.
-
isClosed
private boolean isClosed
Set totrueifoutputStreamis closed.
-
-
Constructor Detail
-
PcapWriter
PcapWriter(java.io.OutputStream outputStream)
This usesOutputStreamfor writing Pcap. Pcap Global Header is not written on construction.
-
PcapWriter
PcapWriter(java.io.OutputStream outputStream, ByteBuf byteBuf) throws java.io.IOExceptionThis usesOutputStreamfor writing Pcap. Pcap Global Header is also written on construction.- Throws:
java.io.IOException- IfOutputStream.write(byte[])throws an exception
-
-
Method Detail
-
writePacket
void writePacket(ByteBuf packetHeaderBuf, ByteBuf packet) throws java.io.IOException
Write Packet in Pcap OutputStream.- Parameters:
packetHeaderBuf- Packer HeaderByteBufpacket- Packet- Throws:
java.io.IOException- IfOutputStream.write(byte[])throws an exception
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-