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 FitsElement
This interface allows to easily perform basic I/O operations on a FITS
element.
-
Method Summary
Modifier and TypeMethodDescriptionlong
long
getSize()
void
read
(ArrayDataInput in) Read a data array into the current object and if needed position to the beginning of the next FITS block.boolean
reset()
Reset the input stream to point to the beginning of this elementvoid
rewrite()
Rewrite the contents of the element in place.boolean
void
write
(ArrayDataOutput out) Write the contents of the element to a data sink.
-
Method Details
-
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
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.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
Rewrite 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.IOException
- if the rewrite was unsuccessful.
-
rewriteable
boolean rewriteable()- Returns:
true
if this element can be rewritten?
-
write
Write the contents of the element to a data sink.- Parameters:
out
- The data sink.- Throws:
FitsException
- if the write was unsuccessful.IOException
- if the write was unsuccessful.
-