Package edu.sc.seis.seisFile.mseed
Class SeedRecord
- java.lang.Object
-
- edu.sc.seis.seisFile.mseed.SeedRecord
-
- Direct Known Subclasses:
ControlRecord,DataRecord
public abstract class SeedRecord extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static BlocketteFactoryblocketteFactoryprotected java.util.List<Blockette>blockettesstatic java.lang.StringDEFAULT_INDENTprotected ControlHeaderheaderprotected intRECORD_SIZE
-
Constructor Summary
Constructors Constructor Description SeedRecord(ControlHeader header)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBlockette(Blockette b)static BlocketteFactorygetBlocketteFactory()Blockette[]getBlockettes()Blockette[]getBlockettes(int type)ControlHeadergetControlHeader()PartialBlockettegetFirstPartialBlockette()if a seed blockette is continued in this record, a PartialBlockette will exist here.PartialBlockettegetLastPartialBlockette()if a seed blockette is continued in the next record, a PartialBlockette will exist here.intgetNumBlockettes(int type)intgetRecordSize()BlockettegetUniqueBlockette(int type)static SeedRecordread(byte[] bytes)static SeedRecordread(java.io.DataInput inStream)static SeedRecordread(java.io.DataInput inStream, int defaultRecordSize)allows setting of a default record size, making reading of miniseed that lack a Blockette1000.static voidsetBlocketteFactory(BlocketteFactory bf)java.lang.StringtoString()voidwriteASCII(java.io.PrintWriter out)voidwriteASCII(java.io.PrintWriter out, java.lang.String indent)
-
-
-
Field Detail
-
blocketteFactory
protected static BlocketteFactory blocketteFactory
-
DEFAULT_INDENT
public static final java.lang.String DEFAULT_INDENT
- See Also:
- Constant Field Values
-
header
protected ControlHeader header
-
blockettes
protected java.util.List<Blockette> blockettes
-
RECORD_SIZE
protected int RECORD_SIZE
-
-
Constructor Detail
-
SeedRecord
public SeedRecord(ControlHeader header)
-
-
Method Detail
-
setBlocketteFactory
public static void setBlocketteFactory(BlocketteFactory bf)
-
getBlocketteFactory
public static BlocketteFactory getBlocketteFactory()
-
read
public static SeedRecord read(java.io.DataInput inStream) throws java.io.IOException, SeedFormatException
- Throws:
java.io.IOExceptionSeedFormatException
-
read
public static SeedRecord read(byte[] bytes) throws java.io.IOException, SeedFormatException
- Throws:
java.io.IOExceptionSeedFormatException
-
read
public static SeedRecord 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.IOExceptionSeedFormatException
-
addBlockette
public void addBlockette(Blockette b) throws SeedFormatException
- Throws:
SeedFormatException
-
getBlockettes
public Blockette[] getBlockettes()
-
getUniqueBlockette
public Blockette getUniqueBlockette(int type) throws SeedFormatException
- Throws:
SeedFormatException
-
getNumBlockettes
public int getNumBlockettes(int type) throws SeedFormatException- Throws:
SeedFormatException
-
getBlockettes
public Blockette[] getBlockettes(int type)
-
getFirstPartialBlockette
public PartialBlockette getFirstPartialBlockette()
if a seed blockette is continued in this record, a PartialBlockette will exist here. It will know its type and length, but will not have all its needed bytes. The prior Seed Record, possibly with reading the subsequent Seed Record should allow the remaining portion of the data to be read. This returns null in the case of no first partial blockette existing.
-
getLastPartialBlockette
public PartialBlockette getLastPartialBlockette()
if a seed blockette is continued in the next record, a PartialBlockette will exist here. It will know its type and length, but will not have all its needed bytes. Reading the subsequent Seed Record should allow the remaining portion of the data to be read. This returns null in the case of no partial blockette existing.
-
getControlHeader
public ControlHeader getControlHeader()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
writeASCII
public void writeASCII(java.io.PrintWriter out) throws java.io.IOException- Throws:
java.io.IOException
-
writeASCII
public void writeASCII(java.io.PrintWriter out, java.lang.String indent) throws java.io.IOException- Throws:
java.io.IOException
-
getRecordSize
public int getRecordSize()
-
-