|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--edu.iris.Fissures.seed.codec.Steim1
Class for decoding or encoding Steim1-compressed data blocks to or from an array of integer values.
Steim compression scheme Copyrighted by Dr. Joseph Steim.
| Constructor Summary | |
Steim1()
|
|
| 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 1 * 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 |
| Constructor Detail |
public Steim1()
| Method Detail |
public static int[] decode(byte[] b,
int numSamples,
boolean swapBytes,
int bias)
throws SeedException
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.SeedFormatException - - encoded data length is not multiple of 64
bytes.
public static int[] decode(byte[] b,
int numSamples,
boolean swapBytes)
throws SeedException
decode(byte[],int,boolean,int)
public static SteimFrameBlock encode(int[] samples,
int frames,
int bias)
throws SeedException
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 0SeedInputException - samples array is zero sizeSeedInputException - number of frames is not a positive valueSeedInputException - cannot encode more than 63 frames
public static SteimFrameBlock encode(int[] samples,
int frames)
throws SeedException
encode(int[],int,int)
protected 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 SeedException
args - not usedSeedException - from called method(s)
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||