edu.sc.seis.seisFile.mseed
Class DataRecord

java.lang.Object
  extended by edu.sc.seis.seisFile.mseed.SeedRecord
      extended by edu.sc.seis.seisFile.mseed.DataRecord
All Implemented Interfaces:
java.io.Serializable

public class DataRecord
extends SeedRecord
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
protected  byte[] data
           
 
Fields inherited from class edu.sc.seis.seisFile.mseed.SeedRecord
blockettes, header
 
Constructor Summary
DataRecord(DataHeader header)
           
DataRecord(DataRecord record)
           
 
Method Summary
 void addBlockette(Blockette b)
           
 byte[] getData()
          returns the data from this data header unparsed, is as a byte array in the format from blockette 1000.
 int getDataSize()
           
 DataHeader getHeader()
           
 int getRecordSize()
           
static DataRecord read(java.io.DataInput inStream, int defaultRecordSize)
          allows setting of a default record size, making reading of miniseed that lack a Blockette1000.
static DataRecord read(java.io.DataInputStream inStream)
           
protected static DataRecord readDataRecord(java.io.DataInput inStream, DataHeader header, int defaultRecordSize)
           
protected  void recheckDataOffset()
           
 void setData(byte[] data)
           
 void setRecordSize(int recordSize)
           
 java.lang.String toString()
           
 void write(java.io.DataOutputStream dos)
           
 void writeASCII(java.io.Writer out)
           
 
Methods inherited from class edu.sc.seis.seisFile.mseed.SeedRecord
getBlockettes, getBlockettes, getNumBlockettes, getUniqueBlockette
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

data

protected byte[] data
Constructor Detail

DataRecord

public DataRecord(DataHeader header)

DataRecord

public DataRecord(DataRecord record)
Method Detail

addBlockette

public void addBlockette(Blockette b)
                  throws SeedFormatException
Overrides:
addBlockette in class SeedRecord
Throws:
SeedFormatException

recheckDataOffset

protected void recheckDataOffset()
                          throws SeedFormatException
Throws:
SeedFormatException

getData

public byte[] getData()
returns the data from this data header unparsed, is 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.


setData

public void setData(byte[] data)
             throws SeedFormatException
Throws:
SeedFormatException

getDataSize

public int getDataSize()

getHeader

public DataHeader getHeader()

write

public void write(java.io.DataOutputStream dos)
           throws java.io.IOException
Throws:
java.io.IOException

read

public static DataRecord read(java.io.DataInputStream inStream)
                       throws java.io.IOException,
                              SeedFormatException
Throws:
java.io.IOException
SeedFormatException

read

public static DataRecord read(java.io.DataInput inStream,
                              int defaultRecordSize)
                       throws java.io.IOException,
                              SeedFormatException
allows setting of a default record size, making reading of miniseed that lack a Blockette1000. Compression is still unknown, but at least the record can be read in and manipulated. A value of 0 for defaultRecordSize means there must be a blockette 1000 or a MissingBlockette1000 will be thrown. If an exception is thrown and the underlying stream supports it, the stream will be reset to its state prior to any bytes being read. The buffer in the underlying stream must be large enough buffer any values read prior to the exception. A buffer sized to be the largest seed record expected is sufficient and so 4096 is a reasonable buffer size.

Throws:
java.io.IOException
SeedFormatException

readDataRecord

protected static DataRecord readDataRecord(java.io.DataInput inStream,
                                           DataHeader header,
                                           int defaultRecordSize)
                                    throws java.io.IOException,
                                           SeedFormatException
Throws:
java.io.IOException
SeedFormatException

getRecordSize

public int getRecordSize()

setRecordSize

public void setRecordSize(int recordSize)
                   throws SeedFormatException
Throws:
SeedFormatException

toString

public java.lang.String toString()
Overrides:
toString in class SeedRecord

writeASCII

public void writeASCII(java.io.Writer out)
                throws java.io.IOException
Throws:
java.io.IOException