Package com.silabs.na.pcap.impl
Class PcapngInputNio
- java.lang.Object
-
- com.silabs.na.pcap.impl.PcapngInputNio
-
- All Implemented Interfaces:
IPcapInput,java.io.Closeable,java.lang.AutoCloseable
public class PcapngInputNio extends java.lang.Object implements IPcapInput
PCAP NG format: https://github.com/pcapng/pcapng/ First 4 bytes must be: 0a0d0d0a, which is a section header block. This class is NOT thread safe. Different threads should create different instance of this class.
-
-
Constructor Summary
Constructors Constructor Description PcapngInputNio(java.nio.channels.ReadableByteChannel rbc)Is is 4 bytes into it.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the input stream.BlocknextBlock()Returns the next block or null if none is present.java.lang.Stringtype()Returns type of the file.
-
-
-
Method Detail
-
type
public java.lang.String type()
Returns type of the file. In this case: "pcapng"- Specified by:
typein interfaceIPcapInput- Returns:
- "pcapng"
-
close
public void close() throws java.io.IOExceptionCloses the input stream.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
nextBlock
public Block nextBlock() throws java.io.IOException
Returns the next block or null if none is present.- Specified by:
nextBlockin interfaceIPcapInput- Returns:
- Next block or null.
- Throws:
java.io.IOException- if anything went wrong with underlying IO operations.
-
-