nom.tam.fits
Class FitsHeap

java.lang.Object
  extended by nom.tam.fits.FitsHeap
All Implemented Interfaces:
FitsElement

public class FitsHeap
extends java.lang.Object
implements FitsElement

This class supports the FITS heap. This is currently used for variable length columns in binary tables.


Method Summary
 void getData(int offset, java.lang.Object array)
          Get data from the heap.
 long getFileOffset()
          Get the byte at which this element begins.
 int getOffset()
          Get the current offset within the heap.
 long getSize()
          The size of this element in bytes
 void read(ArrayDataInput str)
          Read the heap
 void rewrite()
          Attempt to rewrite the heap with the current contents.
 boolean rewriteable()
          Can this element be rewritten?
 int size()
           
 void write(ArrayDataOutput str)
          Write the heap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

read

public void read(ArrayDataInput str)
          throws FitsException
Read the heap

Specified by:
read in interface FitsElement
Parameters:
str - The input source.
Throws:
FitsException

write

public void write(ArrayDataOutput str)
           throws FitsException
Write the heap

Specified by:
write in interface FitsElement
Parameters:
str - The data sink.
Throws:
FitsException

rewriteable

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

Specified by:
rewriteable in interface FitsElement

rewrite

public void rewrite()
             throws java.io.IOException,
                    FitsException
Attempt to rewrite the heap with the current contents. Note that no checking is done to make sure that the heap does not extend past its prior boundaries.

Specified by:
rewrite in interface FitsElement
Throws:
java.io.IOException
FitsException

getData

public void getData(int offset,
                    java.lang.Object array)
             throws FitsException
Get data from the heap.

Parameters:
offset - The offset at which the data begins.
array - The array to be extracted.
Throws:
FitsException

getOffset

public int getOffset()
Get the current offset within the heap.


size

public int size()

getSize

public long getSize()
Description copied from interface: FitsElement
The size of this element in bytes

Specified by:
getSize in interface FitsElement

getFileOffset

public long getFileOffset()
Description copied from interface: FitsElement
Get the byte at which this element begins. This is only available if the data is originally read from a random access medium.

Specified by:
getFileOffset in interface FitsElement