|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Record
A record within a capture file. Capture files contain multiple records which contain data. This interface provides access to a generic Record. Each record has at minimum, a header and content area. You can use various methods in this interface to access and manipulate these standard fields within the record.
Record consists of a header and record content. Records retrieve the header
and content into separate buffers. Also when you modify the record you may
supply each of the two buffers separately. You may use getHeaderBuffer() and
#getContentBuffer method calls to retrieve raw buffers.
The header contains information about the record. The most important of which
is the type of record and record's overall length. Use the getRecordType() method
to get the records type and getRecordLength() to get the entire record's length.
| Nested Class Summary | |
|---|---|
static class |
Record.Capability
Enum constants that describe certain capabilities and thus information a particular type of record may contain. |
static interface |
Record.RecordType
Interface that allows retrieval of type information about each impelementation specific record type. |
| Method Summary | |
|---|---|
FileCapture |
getCaptureFile()
|
long |
getFilePosition()
Returns the file position of the start of this record. |
java.nio.ByteBuffer |
getHeaderBuffer()
|
int |
getHeaderLength()
|
long |
getRecordLength()
Returns the length of this record in bytes. |
Record.RecordType |
getRecordType()
Returns the type of this record. |
boolean |
isModified()
|
boolean |
isWritten()
|
void |
read()
Reads the record's header and content into separate buffers. |
void |
readHeader()
Reads the record header into the internally allocated buffer. |
void |
setFilePosition(long position)
|
void |
setModified(boolean state)
|
void |
setWritten(boolean state)
|
void |
validateRecord()
|
void |
write()
Writes the contents of the entire record from the internally allocated header and content buffers. |
void |
writeHeader()
|
| Method Detail |
|---|
FileCapture getCaptureFile()
long getFilePosition()
void setFilePosition(long position)
long getRecordLength()
Returns the length of this record in bytes. The record length includes the record header, from the start of the record, and contains all the data within the record. The formula GetFilePosition() + getLength() points at the first byte of the next record.
The record's length is not directly set but determined by the current
buffers set on the record. That is the total record length is
getRecordLength() + #getDataLength() which are
determined by the reading values directly from the currently set record
header.
Record.RecordType getRecordType()
java.nio.ByteBuffer getHeaderBuffer()
int getHeaderLength()
void read()
throws java.io.IOException
Reads the record's header and content into separate buffers.
The buffers are allocated internally or by user using
#setHeaderBuffer and #setContentBuffer methods.
The start of the record is read from the position as returned by
#getFilePostion method.
java.io.IOException - any IO errors
void write()
throws java.io.IOException
Writes the contents of the entire record from the internally allocated header and content buffers. The method sets the record length or equivelent fields within the record's header to the length of the entire record or just its content. The exact specification is file format dependent.
java.io.IOException - any IO errors
void readHeader()
throws java.io.IOException
java.io.IOException - any IO errors
void writeHeader()
throws java.io.IOException
java.io.IOException
void validateRecord()
throws java.io.IOException,
CaptureFormatException
java.io.IOException
CaptureFormatExceptionboolean isWritten()
void setWritten(boolean state)
boolean isModified()
void setModified(boolean state)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||