public class HDecompressor
extends java.lang.Object
DataInputStream dis = new DataInputStream( new FileInputStream(arg[0])); byte [] pixels=Hdecomp.decomp( (InputStream)dis );where the user needs to translate the byte stream back into a series of shorts.
DataInputStream dis = new DataInputStream( new FileInputStream(arg[0])); Hdecomp hd = new Hdecomp(dis); hd.decomp(); int[] pixels = hd.getImage(); int nx = hd.getNx(); int ny = hd.getNy();
Constructor and Description |
---|
HDecompressor()
Create a bare decompressor object.
|
HDecompressor(java.io.InputStream dis)
Create a decompressor associating it with a given input stream.
|
Modifier and Type | Method and Description |
---|---|
void |
decompress()
Decompress the input stream.
|
static int[] |
decompress(java.io.InputStream fdis)
Hdecompress static method.
|
int[] |
getImage()
Get decompressed image as a one-d array of ints.
|
int |
getNx()
Get the X-dimension of the decompressed image.
|
int |
getNy()
Get the Y-dimension of the decompressed image.
|
void |
setInputStream(java.io.InputStream dis)
Set the input stream for an Hdecomp object.
|
public HDecompressor()
public HDecompressor(java.io.InputStream dis)
dis
- The input stream from which the compressed data is derived.public void setInputStream(java.io.InputStream dis)
dis
- The input stream from which the compressed data is derived.public static int[] decompress(java.io.InputStream fdis) throws java.lang.Exception
fdis
- The input stream from which compressed data
is to be extracted. It should begin with the
magic characters [0xDD, 0x99]. If the compressed data
is preceded by a FITS header it is the responsibility
of the program to skip past the header before
calling this routine.java.lang.Exception
public void decompress() throws java.lang.Exception
java.lang.Exception
public int getNx()
public int getNy()
public int[] getImage()