public abstract class Record
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
Record(RecordPlan plan,
java.lang.String abbrev)
Constructs a record with no known record type.
|
protected |
Record(RecordPlan plan,
java.lang.String abbrev,
int fixedType)
Constructs a record with a known record type.
|
Modifier and Type | Method and Description |
---|---|
protected void |
checkEndRecord(Pointer ptr)
Checks that a pointer is positioned at the end of this record.
|
Buf |
getBuf()
Returns the buffer containing the record data.
|
long |
getContentOffset()
Returns the buffer offset of the first field in this record after
the record size and type values.
|
long |
getRecordSize()
Returns the size of the record in bytes.
|
int |
getRecordType()
Returns the type code identifying what kind of CDF record it is.
|
java.lang.String |
getRecordTypeAbbreviation()
Returns the abbreviated form of the record type for this record.
|
static boolean |
hasBit(int flags,
int ibit)
Indicates whether a given bit of a flags mask is set.
|
static int[] |
readIntArray(Buf buf,
Pointer ptr,
int count)
Reads a moderately-sized array of 4-byte big-endian integers.
|
static long[] |
readOffsetArray(Buf buf,
Pointer ptr,
int count)
Reads a moderately-sized offset 8-byte big-endian integers.
|
static java.lang.String[] |
toLines(java.lang.String text)
Splits an ASCII string into 0x0A-terminated lines.
|
protected void |
warnFormat(java.lang.String msg)
Called by
check* methods to issue a warning if the
check has failed. |
protected Record(RecordPlan plan, java.lang.String abbrev)
plan
- basic record informationabbrev
- abreviated name for record typeprotected Record(RecordPlan plan, java.lang.String abbrev, int fixedType)
plan
- basic record informationabbrev
- abreviated name for record typefixedType
- record type asserted for this recordpublic long getRecordSize()
public int getRecordType()
public Buf getBuf()
public java.lang.String getRecordTypeAbbreviation()
public long getContentOffset()
protected void checkEndRecord(Pointer ptr)
ptr
- pointer notionally positioned at end of recordprotected void warnFormat(java.lang.String msg)
check*
methods to issue a warning if the
check has failed.msg
- message to outputpublic static int[] readIntArray(Buf buf, Pointer ptr, int count) throws java.io.IOException
buf
- bufferptr
- pointercount
- number of values to readcount
-element array of valuesjava.io.IOException
public static long[] readOffsetArray(Buf buf, Pointer ptr, int count) throws java.io.IOException
buf
- bufferptr
- pointercount
- number of values to readcount
-element array of valuesjava.io.IOException
public static java.lang.String[] toLines(java.lang.String text)
text
- string containing ASCII characterspublic static boolean hasBit(int flags, int ibit)
flags
- flags maskibit
- bit index; 0 is the least significant