public class Steim1
extends java.lang.Object
Steim compression scheme Copyrighted by Dr. Joseph Steim.
| Constructor and Description |
|---|
Steim1() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
static SteimFrameBlock |
encode(int[] samples,
int frames,
int bias,
int offset) |
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.
|
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
SteimExceptionedu.iris.Fissures.codec.Steim1#decode(byte[],int,boolean,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 0SteimException - samples array is zero sizeSteimException - number of frames is not a positive valueSteimException - cannot encode more than 63 framespublic static SteimFrameBlock encode(int[] samples, int frames, int bias, int offset) throws SteimException
SteimExceptionpublic static SteimFrameBlock encode(int[] samples, int frames) throws SteimException
SteimExceptionedu.iris.Fissures.codec.Steim1#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 readpublic static void main(java.lang.String[] args)
throws SteimException
args - not usedSteimException - from called method(s)