Package edu.iris.dmc.seedcodec
Class SteimFrameBlock
java.lang.Object
edu.iris.dmc.seedcodec.SteimFrameBlock
This class acts as a container to hold encoded bytes processed
by a Steim compression routine, as well as supporting information
relating to the data processed.
It also facilitates Steim notation and the formation
of the data frames.
This class stores the Steim encoding, but is ignorant of the encoding
process itself...it's just for self-referencing.
-
Constructor Summary
ConstructorsConstructorDescriptionSteimFrameBlock
(int maxNumFrames, int steimVersion) Create a new block of Steim frames for a particular version of Steim copression. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
addEncodedWord
(int word, int samples, int nibble) Add a single 32-bit word to current frame.byte[]
Return the compressed byte representation of the data for inclusion in a data record.int
Return the number of frames in this frame blockint
Return the number of data samples represented by this frame blockedu.iris.dmc.seedcodec.SteimFrameBlock.SteimFrame[]
int
Return the version of Steim compression usedint
Deprecated.protected void
setXsubN
(int word) Set the reverse integration constant X(N) explicitly to the provided word value.void
Deprecated.
-
Constructor Details
-
SteimFrameBlock
public SteimFrameBlock(int maxNumFrames, int steimVersion) Create a new block of Steim frames for a particular version of Steim copression. Instantiate object with the number of 64-byte frames that this block will contain (should connect to data record header such that a proper power of 2 boundary is formed for the data record) AND the version of Steim compression used (1 and 2 currently) the number of frames remains static...frames that are not filled with data are simply full of nulls.- Parameters:
maxNumFrames
- the max number of frames in this Steim record, zero for unlimitedsteimVersion
- which version of Steim compression is being used (1,2,3).
-
-
Method Details
-
getNumSamples
public int getNumSamples()Return the number of data samples represented by this frame block- Returns:
- integer value indicating number of samples
-
getSteimVersion
public int getSteimVersion()Return the version of Steim compression used- Returns:
- integer value representing the Steim version (1,2,3)
-
getSteimFrames
public edu.iris.dmc.seedcodec.SteimFrameBlock.SteimFrame[] getSteimFrames() -
numNonEmptyFrames
Deprecated.Now list based, so no longer useful.- Returns:
-
trimEmptyFrames
Deprecated.Now list based, so trim not needed. NoOp. -
getEncodedData
Return the compressed byte representation of the data for inclusion in a data record.- Returns:
- byte array containing the encoded, compressed data
- Throws:
IOException
- from called method(s)
-
getNumFrames
public int getNumFrames()Return the number of frames in this frame block- Returns:
- integer value indicating number of frames
-
addEncodedWord
Add a single 32-bit word to current frame.- Parameters:
samples
- the number of sample differences in the wordnibble
- a value of 0 to 3 that reflects the W0 encoding for this word- Returns:
- boolean indicating true if the block is full (ie: the calling app should not add any more to this object)
- Throws:
SteimException
-
setXsubN
protected void setXsubN(int word) Set the reverse integration constant X(N) explicitly to the provided word value. This method is typically used to reset X(N) should the compressor fill the frame block before all samples have been read.- Parameters:
word
- integer value to be placed in X(N)
-