Package nom.tam.fits
Interface FitsElement
-
- All Known Implementing Classes:
AbstractTableData,AsciiTable,AsciiTableHDU,BasicHDU,BinaryTable,BinaryTableHDU,CompressedImageData,CompressedImageHDU,CompressedTableData,CompressedTableHDU,Data,FitsHeap,Header,ImageData,ImageHDU,RandomGroupsData,RandomGroupsHDU,TableHDU,UndefinedData,UndefinedHDU
public interface FitsElementThis interface allows to easily perform basic I/O operations on a FITS element.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longgetFileOffset()longgetSize()voidread(ArrayDataInput in)Read a data array into the current object and if needed position to the beginning of the next FITS block.booleanreset()Reset the input stream to point to the beginning of this elementvoidrewrite()Rewrite the contents of the element in place.booleanrewriteable()voidwrite(ArrayDataOutput out)Write the contents of the element to a data sink.
-
-
-
Method Detail
-
getFileOffset
long getFileOffset()
- Returns:
- the byte at which this element begins. This is only available if the data is originally read from a random access medium.
-
getSize
long getSize()
- Returns:
- The size of this element in bytes
-
read
void read(ArrayDataInput in) throws FitsException, java.io.IOException
Read a data array into the current object and if needed position to the beginning of the next FITS block.- Parameters:
in- The input data stream- Throws:
FitsException- if the read was unsuccessful.java.io.IOException- if the read was unsuccessful.
-
reset
boolean reset()
Reset the input stream to point to the beginning of this element- Returns:
- True if the reset succeeded.
-
rewrite
void rewrite() throws FitsException, java.io.IOExceptionRewrite the contents of the element in place. The data must have been originally read from a random access device, and the size of the element may not have changed.- Throws:
FitsException- if the rewrite was unsuccessful.java.io.IOException- if the rewrite was unsuccessful.
-
rewriteable
boolean rewriteable()
- Returns:
trueif this element can be rewritten?
-
write
void write(ArrayDataOutput out) throws FitsException, java.io.IOException
Write the contents of the element to a data sink.- Parameters:
out- The data sink.- Throws:
FitsException- if the write was unsuccessful.java.io.IOException- if the write was unsuccessful.
-
-