java.lang.Object
java.io.InputStream
com.voytechs.jnetstream.io.ProtocolDataInputStream
com.voytechs.jnetstream.io.PacketInputStream
com.voytechs.jnetstream.io.RawformatInputStream
- All Implemented Interfaces:
- java.io.Closeable
- public class RawformatInputStream
- extends PacketInputStream
| Fields inherited from class com.voytechs.jnetstream.io.PacketInputStream |
captureDeviceArch, captureDeviceFilename, captureDeviceIp, captureDeviceOS, captureLive, linkType, packetCaptureTimestamp, packetEnd, packetLength, packetSnaplen, packetStart, recordEnd, recordLength, recordStart, stackIn |
| Methods inherited from class com.voytechs.jnetstream.io.PacketInputStream |
bitsLeft, clear, getCaptureDeviceAddress, getCaptureDeviceArch, getCaptureDeviceFilename, getCaptureDeviceIp, getCaptureDeviceOS, getCaptureTimestamp, getLinkType, getPacketEnd, getPacketLength, getPacketLengthRemaining, getPacketSnaplen, getPacketStart, getRecordEnd, getRecordHeaderLength, getRecordLength, getRecordStart, goToEndOfRecord, gotoMark, hasForceRead, hex, isCaptureLive, isPacketReady, isReady, isReady, nextPacket, pop, position, printStream, push, push, read, setCaptureTimestamp, setForceRead, setLinkType, setPacketLength, setPacketSnaplen, setPacketStart, setRecordLength, setRecordStart, skip |
| Methods inherited from class com.voytechs.jnetstream.io.ProtocolDataInputStream |
readBits, readBitsLong, readBoolean, readByte, readFromPacket, readFromPacket, readInt, readIntLittleEndian, readLong, readLongLittleEndian, readShort, readShortLittleEndian, readUnsignedByte, readUnsignedInt, readUnsignedIntLittleEndian, readUnsignedShort, readUnsignedShortLittleEndian, reThrow |
debug
private static final boolean debug
- See Also:
- Constant Field Values
FILE_HEADER
public static final java.lang.String FILE_HEADER
- See Also:
- Constant Field Values
PACKET_HEADER_POSTFIX
public static final java.lang.String PACKET_HEADER_POSTFIX
- See Also:
- Constant Field Values
MAX_PACKET_LENGTH
public static final int MAX_PACKET_LENGTH
- See Also:
- Constant Field Values
FILE_TYPENAME
public static final java.lang.String FILE_TYPENAME
- See Also:
- Constant Field Values
FILE_RECORDLEN
public static final java.lang.String FILE_RECORDLEN
- See Also:
- Constant Field Values
PACKET_LINKTYPE
public static final java.lang.String PACKET_LINKTYPE
- See Also:
- Constant Field Values
PACKET_LENGTH
public static final java.lang.String PACKET_LENGTH
- See Also:
- Constant Field Values
PACKET_SNAPLEN
public static final java.lang.String PACKET_SNAPLEN
- See Also:
- Constant Field Values
PACKET_SECONDS
public static final java.lang.String PACKET_SECONDS
- See Also:
- Constant Field Values
PACKET_MICROS
public static final java.lang.String PACKET_MICROS
- See Also:
- Constant Field Values
INTERFACE_DROPS
public static final java.lang.String INTERFACE_DROPS
- See Also:
- Constant Field Values
INTERFACE_IN
public static final java.lang.String INTERFACE_IN
- See Also:
- Constant Field Values
INTERFACE_OUT
public static final java.lang.String INTERFACE_OUT
- See Also:
- Constant Field Values
INTERFACE_ERROR
public static final java.lang.String INTERFACE_ERROR
- See Also:
- Constant Field Values
decoder
protected com.voytechs.jnetstream.codec.Decoder decoder
- The decoder used to decode capture file headers.
packetHeader
protected java.lang.String packetHeader
RawformatInputStream
public RawformatInputStream(java.io.InputStream rawFileFormatInputStream,
java.lang.String nplFormatFile)
throws java.io.IOException,
EOPacketStream,
StreamFormatException,
com.voytechs.jnetstream.npl.SyntaxError
RawformatInputStream
public RawformatInputStream(java.lang.String captureFile,
java.lang.String nplFormatFile)
throws java.io.FileNotFoundException,
java.io.IOException,
EOPacketStream,
StreamFormatException,
com.voytechs.jnetstream.npl.SyntaxError
- Opens up the given file and starts processing the data.
initPacketStream
protected void initPacketStream()
throws java.io.IOException,
EOPacketStream,
StreamFormatException
- Since we know we are dealing with a Snoop-file formatted stream
(i.e. FileInputStream("raw-capturefile.raw")) we initialize
the ProtocolInputStream using values extracted from the raw stream.
First we extract the "raw_file_heaer" as specified above.
- Overrides:
initPacketStream in class PacketInputStream
readPacketPreHeader
protected void readPacketPreHeader()
throws java.io.IOException,
EOPacketStream,
StreamFormatException
- Read pre-packet header from stream. With basic info about the next
packet to follow.
this is called for every packet in the stream. Main purpose is to
get packet-data length (or length of captured packet) and the
capture time of the packet.
- Overrides:
readPacketPreHeader in class PacketInputStream
extractValues
protected void extractValues(com.voytechs.jnetstream.codec.Packet packet)
throws StreamFormatException
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object
- Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method
never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string
concatenation with this object. If the result is
null, string concatenation will instead
use "null".
The default implementation returns
getClass().getName() + "@" +
Integer.toHexString(hashCode()).
main
public static void main(java.lang.String[] args)
- Test function for RawformatInputStream