Package uk.ac.bristol.star.cdf.record
Class RecordPlan
java.lang.Object
uk.ac.bristol.star.cdf.record.RecordPlan
Records basic information about the position, extent and type of
a CDF record.
- Since:
- 18 Jun 2013
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a pointer initially pointing at the first content byte of the record represented by this plan.getBuf()
Returns the buffer containing the record data.long
getReadCount
(Pointer ptr) Returns the number of bytes in this record read (or skipped) by the current state of a given pointer.long
Returns the size of the record in bytes.int
Returns the type code identifying what kind of CDF record it is.
-
Constructor Details
-
RecordPlan
Constructor.- Parameters:
start
- offset into buffer of record startrecSize
- number of bytes comprising recordrecType
- integer record type fieldbuf
- buffer containing record bytes
-
-
Method Details
-
getRecordSize
public long getRecordSize()Returns the size of the record in bytes.- Returns:
- record size
-
getRecordType
public int getRecordType()Returns the type code identifying what kind of CDF record it is.- Returns:
- record type
-
getBuf
Returns the buffer containing the record data.- Returns:
- buffer
-
createContentPointer
Returns a pointer initially pointing at the first content byte of the record represented by this plan. This is the first item after the RecordSize and RecordType items that always appear first in a CDF record, and whose values are known by this object.- Returns:
- pointer pointing at the start of the record-type-specific content
-
getReadCount
Returns the number of bytes in this record read (or skipped) by the current state of a given pointer.- Parameters:
ptr
- pointer- Returns:
- number of bytes between record start and pointer value
-