org.jnetstream.capture.file
Interface BlockRecord

All Superinterfaces:
Record, com.slytechs.utils.collection.Validatable
All Known Subinterfaces:
NAPBlockRecord, PcapBlockRecord, SnoopBlockRecord

public interface BlockRecord
extends Record

A block record also sometimes refered to a file header in a capture file which uniquely identifies the file as certain type with a magic pattern or magic number. Block record contains, as children, one or more data records which usually contain packet data.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jnetstream.capture.file.Record
Record.RecordHeaderField
 
Method Summary
 byte[] getMagicPattern()
          Returns the Magic number or pattern that is used to uniquely identify the file type of the capture file.
 com.slytechs.utils.number.Version getVersion()
          Returns the first file version found.
 java.nio.ByteOrder order()
          Gets the byte-order encoding for integers of fields within the record header.
 void setMajorVersion(long major)
          Sets the version numbers for the file format.
 
Methods inherited from interface org.jnetstream.capture.file.Record
asType, edit, getFileCapture, getPositionGlobal, getRecordBuffer, getRecordHeaderBuffer, getRecordHeaderLength, getRecordLength, getRecordType
 
Methods inherited from interface com.slytechs.utils.collection.Validatable
isValid
 

Method Detail

order

java.nio.ByteOrder order()
Gets the byte-order encoding for integers of fields within the record header.

Returns:
either big or little endian encoding

getVersion

com.slytechs.utils.number.Version getVersion()
                                             throws java.io.IOException
Returns the first file version found. There may be multiple blocks within the file at different versions.

Returns:
version of the file
Throws:
java.io.IOException

setMajorVersion

void setMajorVersion(long major)
                     throws java.io.IOException
Sets the version numbers for the file format.

Parameters:
major - major version of the file format
Throws:
java.io.IOException

getMagicPattern

byte[] getMagicPattern()
                       throws java.io.IOException
Returns the Magic number or pattern that is used to uniquely identify the file type of the capture file. The magic number is not normalized so the pattern may be returned differently on big and small endian machines.

Returns:
pattern that is used to identify the file type
Throws:
java.io.IOException