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 void
close()
Closes the input stream.Block
nextBlock()
Returns the next block or null if none is present.java.lang.String
type()
Returns type of the file.
-
-
-
Method Detail
-
type
public java.lang.String type()
Returns type of the file. In this case: "pcapng"- Specified by:
type
in interfaceIPcapInput
- Returns:
- "pcapng"
-
close
public void close() throws java.io.IOException
Closes the input stream.- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in 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:
nextBlock
in interfaceIPcapInput
- Returns:
- Next block or null.
- Throws:
java.io.IOException
- if anything went wrong with underlying IO operations.
-
-