nom.tam.fits
Class Data

java.lang.Object
  extended by nom.tam.fits.Data
All Implemented Interfaces:
FitsElement
Direct Known Subclasses:
AsciiTable, BinaryTable, ImageData, RandomGroupsData, UndefinedData

public abstract class Data
extends java.lang.Object
implements FitsElement

This class provides methods to access the data segment of an HDU.


Field Summary
protected  int dataSize
          The size of the data when last read
protected  long fileOffset
          The starting location of the data when last read
protected  RandomAccess input
          The inputstream used.
 
Constructor Summary
Data()
           
 
Method Summary
abstract  java.lang.Object getData()
          Return the data array object.
 long getFileOffset()
          Get the file offset
 java.lang.Object getKernel()
          Return the non-FITS data object
 long getSize()
          Get the size of the data element in bytes
abstract  void read(ArrayDataInput i)
          Read a data array into the current object and if needed position to the beginning of the next FITS block.
 void rewrite()
          Rewrite the contents of the element in place.
 boolean rewriteable()
          Can this element be rewritten?
protected  void setFileOffset(java.lang.Object o)
          Set the fields needed for a re-read
abstract  void write(ArrayDataOutput o)
          Write the data -- including any buffering needed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileOffset

protected long fileOffset
The starting location of the data when last read


dataSize

protected int dataSize
The size of the data when last read


input

protected RandomAccess input
The inputstream used.

Constructor Detail

Data

public Data()
Method Detail

getFileOffset

public long getFileOffset()
Get the file offset

Specified by:
getFileOffset in interface FitsElement

setFileOffset

protected void setFileOffset(java.lang.Object o)
Set the fields needed for a re-read


write

public abstract void write(ArrayDataOutput o)
                    throws FitsException
Write the data -- including any buffering needed

Specified by:
write in interface FitsElement
Parameters:
o - The output stream on which to write the data.
Throws:
FitsException

read

public abstract void read(ArrayDataInput i)
                   throws FitsException
Read a data array into the current object and if needed position to the beginning of the next FITS block.

Specified by:
read in interface FitsElement
Parameters:
i - The input data stream
Throws:
FitsException

rewrite

public void rewrite()
             throws FitsException
Description copied from interface: FitsElement
Rewrite the contents of the element in place. The data must have been orignally read from a random access device, and the size of the element may not have changed.

Specified by:
rewrite in interface FitsElement
Throws:
FitsException

rewriteable

public boolean rewriteable()
Description copied from interface: FitsElement
Can this element be rewritten?

Specified by:
rewriteable in interface FitsElement

getSize

public long getSize()
Get the size of the data element in bytes

Specified by:
getSize in interface FitsElement

getData

public abstract java.lang.Object getData()
                                  throws FitsException
Return the data array object.

Throws:
FitsException

getKernel

public java.lang.Object getKernel()
                           throws FitsException
Return the non-FITS data object

Throws:
FitsException