|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | ||||||||
java.lang.Objectjava.lang.Enum<PcapBlockRecord.PcapBlockHeader>
org.jnetstream.capture.file.pcap.PcapBlockRecord.PcapBlockHeader
public static enum PcapBlockRecord.PcapBlockHeader
Defines the static header of a block pcap record. The constants represent each individual field that makes up a Pcap block header (file header).
Please note that this method can easily throw invalid ClassCastException since type cast checking is supressed inorder to convert values read and written to user type. The methods are very flexible but give up the type safety, but since most types are ints, short and longs, its easy to utilize these methods.
| Enum Constant Summary | |
|---|---|
Accuracy
|
|
Linktype
|
|
Magicnumber
|
|
MajorVersion
|
|
MinorVersion
|
|
Snaplen
|
|
Timezone
|
|
| Field Summary | |
|---|---|
static java.nio.ByteBuffer |
buffer
|
static int |
bufferOffset
|
| Method Summary | ||
|---|---|---|
protected int |
getLength()
|
|
int |
getOffset()
|
|
|
read()
Reads the header field using the currently set debug buffer buffer. |
|
|
read(java.nio.ByteBuffer buffer)
Gets the field value from the specified buffer using the global buffer offset of 0. |
|
|
read(java.nio.ByteBuffer buffer,
int start)
Gets the field value from the specified buffer using the global buffer offset start. |
|
java.lang.String |
toStringDebug()
Returns a special debug string for the field. |
|
static PcapBlockRecord.PcapBlockHeader |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
|
static PcapBlockRecord.PcapBlockHeader[] |
values()
Returns an array containing the constants of this enum type, in the order they're declared. |
|
|
write(java.nio.ByteBuffer buffer,
int start,
T value)
Writes the field value from the specified buffer using the global buffer offset of start. |
|
|
write(java.nio.ByteBuffer buffer,
T value)
Writes the field value from the specified buffer using the global buffer offset of 0. |
|
|
write(T value)
Writes the header field using the currently set debug buffer buffer. |
|
| Methods inherited from class java.lang.Enum |
|---|
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Enum Constant Detail |
|---|
public static final PcapBlockRecord.PcapBlockHeader Accuracy
public static final PcapBlockRecord.PcapBlockHeader Linktype
public static final PcapBlockRecord.PcapBlockHeader Magicnumber
public static final PcapBlockRecord.PcapBlockHeader MajorVersion
public static final PcapBlockRecord.PcapBlockHeader MinorVersion
public static final PcapBlockRecord.PcapBlockHeader Snaplen
public static final PcapBlockRecord.PcapBlockHeader Timezone
| Field Detail |
|---|
public static java.nio.ByteBuffer buffer
public static int bufferOffset
| Method Detail |
|---|
public static final PcapBlockRecord.PcapBlockHeader[] values()
for(PcapBlockRecord.PcapBlockHeader c : PcapBlockRecord.PcapBlockHeader.values())
System.out.println(c);
public static PcapBlockRecord.PcapBlockHeader valueOf(java.lang.String name)
name - the name of the enum constant to be returned.
java.lang.IllegalArgumentException - if this enum type has no constant
with the specified nameprotected final int getLength()
public final int getOffset()
public <T> T read()
buffer. The buffer can not be null otherwise
IllegalStateException is thrown.
read in interface Record.RecordHeaderFieldT - the return type of the field
public <T> T read(java.nio.ByteBuffer buffer)
read in interface Record.RecordHeaderFieldT - field's value typebuffer - buffer to read the field's value from
public <T> T read(java.nio.ByteBuffer buffer,
int start)
read in interface Record.RecordHeaderFieldT - field's value typebuffer - buffer to read the field's value fromstart - start or offset within the buffer to offset the field's value
read
public java.lang.String toStringDebug()
toStringDebug in interface Record.RecordHeaderField
public <T> void write(java.nio.ByteBuffer buffer,
int start,
T value)
write in interface Record.RecordHeaderFieldT - field's value typebuffer - buffer to write the field's value tostart - the global offset within the buffer that marks the start of the
headervalue - the new vlue of the field
public <T> void write(java.nio.ByteBuffer buffer,
T value)
write in interface Record.RecordHeaderFieldT - field's value typebuffer - buffer to write the field's value tovalue - the new vlue of the fieldpublic <T> void write(T value)
buffer. The buffer can not be null otherwise
IllegalStateException is thrown.
write in interface Record.RecordHeaderFieldT - the value type of the fieldvalue - the new value of the field
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | ||||||||