|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.iris.dmc.seedcodec.Steim2
public class Steim2
Class for decoding or encoding Steim2-compressed data blocks to or from an array of integer values.
Steim compression scheme Copyrighted by Dr. Joseph Steim.
Field Summary | |
---|---|
static java.io.PrintStream |
debug
|
Constructor Summary | |
---|---|
Steim2()
|
Method Summary | |
---|---|
static int[] |
decode(byte[] b,
int numSamples,
boolean swapBytes)
Abbreviated, zero-bias version of decode(). |
static int[] |
decode(byte[] b,
int numSamples,
boolean swapBytes,
int bias)
Decode the indicated number of samples from the provided byte array and return an integer array of the decompressed values. |
static SteimFrameBlock |
encode(int[] samples,
int frames)
Abbreviated zero-bias version of encode(). |
static SteimFrameBlock |
encode(int[] samples,
int frames,
int bias)
Encode the array of integer values into a Steim 2 * compressed byte frame block. |
static SteimFrameBlock |
encode(int[] samples,
int frames,
int bias,
int samplesLength)
Encode the array of integer values into a Steim 2 * compressed byte frame block. |
protected static int[] |
extractSamples(byte[] bytes,
int offset,
boolean swapBytes)
Extracts differences from the next 64 byte frame of the given compressed byte array (starting at offset) and returns those differences in an int array. |
static void |
main(java.lang.String[] args)
Static method for testing the decode() method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.io.PrintStream debug
Constructor Detail |
---|
public Steim2()
Method Detail |
---|
public static int[] decode(byte[] b, int numSamples, boolean swapBytes, int bias) throws SteimException
b
- input byte array to be decodednumSamples
- the number of samples that can be decoded from array
bswapBytes
- if true, swap reverse the endian-ness of the elements of
byte array b.bias
- the first difference value will be computed from this value.
If set to 0, the method will attempt to use the X(0) constant instead.
SteimException
- - encoded data length is not multiple of 64
bytes.public static int[] decode(byte[] b, int numSamples, boolean swapBytes) throws SteimException
SteimException
Steim2.decode(byte[],int,boolean,int)
public static SteimFrameBlock encode(int[] samples, int frames) throws SteimException
SteimException
edu.iris.Fissures.codec.Steim2#encode(int[],int,int)
public static SteimFrameBlock encode(int[] samples, int frames, int bias) throws SteimException
samples
- the data points represented as signed integersframes
- the number of Steim frames to use in the encodingbias
- offset for use as a constant for the first difference, otherwise
set to 0
SteimException
- samples array is zero size
SteimException
- number of frames is not a positive value
SteimException
- cannot encode more than 63 framespublic static SteimFrameBlock encode(int[] samples, int frames, int bias, int samplesLength) throws SteimException
samples
- the data points represented as signed integersframes
- the number of Steim frames to use in the encodingbias
- offset for use as a constant for the first difference, otherwise
set to 0samplesLength
- the samples length
SteimException
- samples array is zero size
SteimException
- number of frames is not a positive value
SteimException
- cannot encode more than 63 framesprotected static int[] extractSamples(byte[] bytes, int offset, boolean swapBytes)
bytes
- byte array of compressed data differencesoffset
- index to begin reading compressed bytes for decodingswapBytes
- reverse the endian-ness of the compressed bytes being read
public static void main(java.lang.String[] args) throws SteimException
args
- not used
SteimException
- from called method(s)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |