Top Fields Constructors Methods
io.netty.handler.pcap

pack-priv final Class PcapWriter

extends Object
implements Closeable
Class Inheritance
All Implemented Interfaces
java.io.Closeable, java.lang.AutoCloseable
Imports
io.netty.buffer.ByteBuf, io.netty.util.internal.logging.InternalLogger, .InternalLoggerFactory, java.io.Closeable, .IOException, .OutputStream

Field Summary

Modifier and TypeField and Description
private static final InternalLogger
logger

Logger

private final OutputStream
outputStream

Reference declared so that we can use this as mutex in clean way.

private final PcapWriteHandler

Constructor Summary

AccessConstructor and Description
pack-priv
PcapWriter(PcapWriteHandler pcapWriteHandler)

This uses OutputStream for writing Pcap data.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
pack-priv void
writePacket(ByteBuf
Packer Header ByteBuf
packetHeaderBuf
,
ByteBuf
Packet
packet
)

Write Packet in Pcap OutputStream.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

loggerback to summary
private static final InternalLogger logger

Logger

outputStreamback to summary
private final OutputStream outputStream

Reference declared so that we can use this as mutex in clean way.

pcapWriteHandlerback to summary
private final PcapWriteHandler pcapWriteHandler

Constructor Detail

PcapWriterback to summary
pack-priv PcapWriter(PcapWriteHandler pcapWriteHandler) throws IOException

This uses OutputStream for writing Pcap data.

Exceptions
IOException:
If OutputStream#write(byte[]) throws an exception

Method Detail

closeback to summary
public void close() throws IOException

Implements java.io.Closeable.close.

Doc from java.io.Closeable.close.

Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

As noted in AutoCloseable#close(), cases where the close may fail require careful attention. It is strongly advised to relinquish the underlying resources and to internally mark the Closeable as closed, prior to throwing the IOException.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
writePacketback to summary
pack-priv void writePacket(ByteBuf packetHeaderBuf, ByteBuf packet) throws IOException

Write Packet in Pcap OutputStream.

Parameters
packetHeaderBuf:ByteBuf

Packer Header ByteBuf

packet:ByteBuf

Packet

Exceptions
IOException:
If OutputStream#write(byte[]) throws an exception