Begin versioning.
[fits.git] / src / nom / tam / fits / FitsElement.java
1 /** This inteface describes allows uses to easily perform
2  *  basic I/O operations
3  *  on a FITS element.
4  */
5 package nom.tam.fits;
6
7 import nom.tam.util.*;
8 import java.io.IOException;
9
10 public interface FitsElement {
11
12     /** Read the contents of the element from an input source.
13      *  @param in       The input source.
14      */
15     public void read(ArrayDataInput in) throws FitsException, IOException;
16
17     /** Write the contents of the element to a data sink.
18      *  @param out      The data sink.
19      */
20     public void write(ArrayDataOutput out) throws FitsException, IOException;
21
22     /** Rewrite the contents of the element in place.
23      *  The data must have been orignally read from a random
24      *  access device, and the size of the element may not have changed.
25      */
26     public void rewrite() throws FitsException, IOException;
27
28     /** Get the byte at which this element begins.
29      *  This is only available if the data is originally read from
30      *  a random access medium.
31      */
32     public long getFileOffset();
33
34     /** Can this element be rewritten? */
35     public boolean rewriteable();
36
37     /** The size of this element in bytes */
38     public long getSize();
39
40     /** Reset the input stream to point to the beginning of this element
41      * @return True if the reset succeeded.
42      */
43     public boolean reset();
44 }