Class RecordPlan

java.lang.Object
uk.ac.bristol.star.cdf.record.RecordPlan

public class RecordPlan extends Object
Records basic information about the position, extent and type of a CDF record.
Since:
18 Jun 2013
  • Constructor Details

    • RecordPlan

      public RecordPlan(long start, long recSize, int recType, Buf buf)
      Constructor.
      Parameters:
      start - offset into buffer of record start
      recSize - number of bytes comprising record
      recType - integer record type field
      buf - 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

      public Buf getBuf()
      Returns the buffer containing the record data.
      Returns:
      buffer
    • createContentPointer

      public Pointer 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

      public long getReadCount(Pointer ptr)
      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