public class RecordFactory
extends java.lang.Object
Constructor and Description |
---|
RecordFactory(int nameLeng)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Record |
createRecord(Buf buf,
long offset)
Creates a Record object from a given position in a buffer.
|
<R extends Record> |
createRecord(Buf buf,
long offset,
java.lang.Class<R> clazz)
Creates a Record object with a known type from a given position in
a buffer.
|
public RecordFactory(int nameLeng)
nameLeng
- number of bytes in variable and attribute names;
appears to be 64 for pre-v3 and 256 for v3public Record createRecord(Buf buf, long offset) throws java.io.IOException
buf
- byte bufferoffset
- start of record in bufjava.io.IOException
public <R extends Record> R createRecord(Buf buf, long offset, java.lang.Class<R> clazz) throws java.io.IOException
getRecord
method, and attempts to cast the result, throwing a
CdfFormatException if it has the wrong type.buf
- byte bufferoffset
- start of record in bufclazz
- record class asserted for the resultCdfFormatException
- if the record found there turns out
not to be of type clazz
java.io.IOException