Package edu.sc.seis.seisFile.mseed
Class DataRecord
java.lang.Object
edu.sc.seis.seisFile.mseed.SeedRecord
edu.sc.seis.seisFile.mseed.DataRecord
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
FieldsFields inherited from class edu.sc.seis.seisFile.mseed.SeedRecord
blocketteFactory, blockettes, DEFAULT_INDENT, header, RECORD_SIZE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a blockette to the record.edu.iris.dmc.seedcodec.DecompressedData
Decompress the data in this record according to the compression type in the header.byte[]
getData()
returns the data from this data header unparsed, as a byte array in the format from blockette 1000.int
get the value of end time.return a Btime structure containing the derived last sample time for this record.get the value of end time.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
Gets start Btime from header, convenience method.Gets start time from header, convenience method.boolean
static String
void
printData
(PrintWriter out) static SeedRecord
readDataRecord
(DataInput inStream, DataHeader header, int defaultRecordSize) protected void
void
setData
(byte[] data) void
setRecordSize
(int recordSize) byte[]
toString()
void
write
(DataOutputStream dos) Methods inherited from class edu.sc.seis.seisFile.mseed.SeedRecord
getBlocketteFactory, getBlockettes, getBlockettes, getControlHeader, getFirstPartialBlockette, getLastPartialBlockette, getNumBlockettes, getRecordSize, getUniqueBlockette, read, read, read, setBlocketteFactory, writeASCII, writeASCII
-
Field Details
-
data
protected byte[] data
-
-
Constructor Details
-
DataRecord
-
DataRecord
-
-
Method Details
-
addBlockette
Adds a blockette to the record. The number of blockettes in the header is incremented automatically.- Overrides:
addBlockette
in classSeedRecord
- Throws:
SeedFormatException
-
recheckDataOffset
- Throws:
SeedFormatException
-
getData
public byte[] getData()returns the data from this data header unparsed, as a byte array in the format from blockette 1000. The return type is byte[], so the caller must decode the data based on its format. -
isDecompressable
- Throws:
SeedFormatException
-
decompress
public edu.iris.dmc.seedcodec.DecompressedData decompress() throws SeedFormatException, edu.iris.dmc.seedcodec.UnsupportedCompressionType, edu.iris.dmc.seedcodec.CodecExceptionDecompress the data in this record according to the compression type in the header.- Returns:
- Throws:
SeedFormatException
- if no blockette 1000 presentedu.iris.dmc.seedcodec.UnsupportedCompressionType
edu.iris.dmc.seedcodec.CodecException
-
setData
- Throws:
SeedFormatException
-
getDataSize
public int getDataSize() -
getSampleRate
public float getSampleRate() -
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. -
getBtimeRange
-
getLastSampleBtime
return a Btime structure containing the derived last sample time for this record. Note that this will use the more accurate sample rate in a blockette100 if it exists. -
getStartBtime
Gets start Btime from header, convenience method. -
getStartTime
Gets start time from header, convenience method. -
getEndTime
get the value of end time. derived from Start time, sample rate, and number of samples. Note this is not the time of the last sample, but rather the predicted begin time of the next record. Note that this will use the more accurate sample rate in a blockette100 if it exists.- Returns:
- the value of end time
-
getLastSampleTime
get the value of end time. derived from Start time, sample rate, and number of samples. Note that this will use the more accurate sample rate in a blockette100 if it exists.- Returns:
- the value of end time
-
getHeader
-
toByteArray
public byte[] toByteArray() -
write
- Throws:
IOException
-
printData
-
readDataRecord
public static SeedRecord readDataRecord(DataInput inStream, DataHeader header, int defaultRecordSize) throws IOException, SeedFormatException - Throws:
IOException
SeedFormatException
-
setRecordSize
- Throws:
SeedFormatException
-
oneLineSummaryKey
-
oneLineSummary
-
toString
- Overrides:
toString
in classSeedRecord
-