edu.iris.Fissures.codec
Class Steim2

java.lang.Object
  extended by edu.iris.Fissures.codec.Steim2

Deprecated. Please begin use of the edu.iris.dmc.seedcodec package in place of this

@Deprecated
public class Steim2
extends java.lang.Object

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.

Reference material found in:
Appendix B of SEED Reference Manual, 2nd Ed., pp. 119-125 Federation of Digital Seismic Networks, et al. February, 1993
Coding concepts gleaned from code written by:
Guy Stewart, IRIS, 1991
Tom McSweeney, IRIS, 2000

Version:
10/23/2002
Author:
Philip Crotwell (U South Carolina), Robert Casey (IRIS DMC)

Constructor Summary
Steim2()
          Deprecated.  
 
Method Summary
static int[] decode(byte[] b, int numSamples, boolean swapBytes)
          Deprecated. Abbreviated, zero-bias version of decode().
static int[] decode(byte[] b, int numSamples, boolean swapBytes, int bias)
          Deprecated. Decode the indicated number of samples from the provided byte array and return an integer array of the decompressed values.
static byte[] encode(int[] samples)
          Deprecated.  
protected static int[] extractSamples(byte[] bytes, int offset, boolean swapBytes)
          Deprecated. 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)
          Deprecated. 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

Steim2

public Steim2()
Deprecated. 
Method Detail

decode

public static int[] decode(byte[] b,
                           int numSamples,
                           boolean swapBytes,
                           int bias)
                    throws SteimException
Deprecated. 
Decode the indicated number of samples from the provided byte array and return an integer array of the decompressed values. Being differencing compression, there may be an offset carried over from a previous data record. This offset value can be placed in bias, otherwise leave the value as 0.

Parameters:
b - input byte array to be decoded
numSamples - the number of samples that can be decoded from array b
swapBytes - 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.
Returns:
int array of length numSamples.
Throws:
SteimException - - encoded data length is not multiple of 64 bytes.

decode

public static int[] decode(byte[] b,
                           int numSamples,
                           boolean swapBytes)
                    throws SteimException
Deprecated. 
Abbreviated, zero-bias version of decode().

Throws:
SteimException
See Also:
decode(byte[],int,boolean,int)

encode

public static byte[] encode(int[] samples)
Deprecated. 

extractSamples

protected static int[] extractSamples(byte[] bytes,
                                      int offset,
                                      boolean swapBytes)
Deprecated. 
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. An offset of 0 means that we are at the first frame, so include the header bytes in the returned int array...else, do not include the header bytes in the returned array.

Parameters:
bytes - byte array of compressed data differences
offset - index to begin reading compressed bytes for decoding
swapBytes - reverse the endian-ness of the compressed bytes being read
Returns:
integer array of difference (and constant) values

main

public static void main(java.lang.String[] args)
                 throws SteimException
Deprecated. 
Static method for testing the decode() method.

Parameters:
args - not used
Throws:
SteimException - from called method(s)