public class DataRecord extends SeedRecord implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected byte[] |
data |
blocketteFactory, blockettes, header, RECORD_SIZE
Constructor and Description |
---|
DataRecord(DataHeader header) |
DataRecord(DataRecord record) |
Modifier and Type | Method and Description |
---|---|
void |
addBlockette(Blockette b)
Adds a blockette to the record.
|
edu.iris.dmc.seedcodec.DecompressedData |
decompress()
Decompress the data in this record according to the compression type in
the header.
|
BtimeRange |
getBtimeRange() |
byte[] |
getData()
returns the data from this data header unparsed, as a byte array in
the format from blockette 1000.
|
int |
getDataSize() |
java.lang.String |
getEndTime()
get the value of end time.
|
DataHeader |
getHeader() |
Btime |
getLastSampleBtime()
return a Btime structure containing the derived last sample time for this
record.
|
java.lang.String |
getLastSampleTime()
get the value of end time.
|
Btime |
getPredictedNextStartBtime()
returns the predicted start time of the next record, ie begin + numSample*period
Note that this will use the more accurate sample rate in a blockette100 if it exists.
|
float |
getSampleRate() |
Btime |
getStartBtime()
Gets start Btime from header, convenience method.
|
java.lang.String |
getStartTime()
Gets start time from header, convenience method.
|
void |
printData(java.io.PrintWriter out) |
static SeedRecord |
readDataRecord(java.io.DataInput inStream,
DataHeader header,
int defaultRecordSize) |
protected void |
recheckDataOffset() |
void |
setData(byte[] data) |
void |
setRecordSize(int recordSize) |
byte[] |
toByteArray() |
java.lang.String |
toString() |
void |
write(java.io.DataOutputStream dos) |
void |
writeData(java.io.PrintWriter out)
Deprecated.
Confusing method name, use printData(PrintWriter) for textual
output and write(DataOutputStream) for binary output.
|
getBlocketteFactory, getBlockettes, getBlockettes, getControlHeader, getFirstPartialBlockette, getLastPartialBlockette, getNumBlockettes, getRecordSize, getUniqueBlockette, read, read, read, setBlocketteFactory, writeASCII, writeASCII
public DataRecord(DataHeader header)
public DataRecord(DataRecord record)
public void addBlockette(Blockette b) throws SeedFormatException
addBlockette
in class SeedRecord
SeedFormatException
protected void recheckDataOffset() throws SeedFormatException
SeedFormatException
public byte[] getData()
public edu.iris.dmc.seedcodec.DecompressedData decompress() throws SeedFormatException, edu.iris.dmc.seedcodec.UnsupportedCompressionType, edu.iris.dmc.seedcodec.CodecException
SeedFormatException
- if no blockette 1000 presentedu.iris.dmc.seedcodec.UnsupportedCompressionType
edu.iris.dmc.seedcodec.CodecException
public void setData(byte[] data) throws SeedFormatException
SeedFormatException
public int getDataSize()
public float getSampleRate()
public Btime getPredictedNextStartBtime()
public BtimeRange getBtimeRange()
public Btime getLastSampleBtime()
public Btime getStartBtime()
public java.lang.String getStartTime()
public java.lang.String getEndTime()
public java.lang.String getLastSampleTime()
public DataHeader getHeader()
public byte[] toByteArray()
public void write(java.io.DataOutputStream dos) throws java.io.IOException
java.io.IOException
@Deprecated public void writeData(java.io.PrintWriter out)
out
- public void printData(java.io.PrintWriter out)
public static SeedRecord readDataRecord(java.io.DataInput inStream, DataHeader header, int defaultRecordSize) throws java.io.IOException, SeedFormatException
java.io.IOException
SeedFormatException
public void setRecordSize(int recordSize) throws SeedFormatException
SeedFormatException
public java.lang.String toString()
toString
in class SeedRecord