|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BasicInput
Interface defining the basic data input operations required for the FITS reading classes. All the read operations operate at the current position of the assumed stream and advance the current position past the item they just read. Storage is FITS-like, which, happily, matches ByteBuffer conventions. Random access may or may not be supported.
This interface has some similarities to DataInput
,
and that interface could have been used instead, but this one is
explicitly used for the hand-coded FITS reader implementation to
make clear which operations need to be efficient. At present
no multi-byte (or multi-other-primitive-type) read operations are
included, since it's not clear that these are required in practice
for efficient table input, though for (uncommon?) tables that have
columns with large array values that might not be true.
If that turns out to be an important use case, such methods can
be added to this interface, implemented in its implementations,
and used in the clients of this interface.
Instances of this are not expected to be safe for use from multiple threads. Depending on the implementation, ignoring that fact may be a very bad idea indeed.
Method Summary | |
---|---|
void |
close()
Releases resources belonging to this object. |
long |
getOffset()
Returns the curent position in this stream (optional operation). |
boolean |
isRandom()
Indicates whether this object supports random access. |
byte |
readByte()
Reads a byte from the stream. |
double |
readDouble()
Reads an 8-byte floating point value from the stream. |
float |
readFloat()
Reads a 4-byte floating point value from the stream. |
int |
readInt()
Reads a 4-byte integer from the stream. |
long |
readLong()
Reads an 8-byte integer from the stream. |
short |
readShort()
Reads a 2-byte integer from the stream. |
void |
seek(long offset)
Moves the current position of this stream to a given byte offset (optional operation). |
void |
skip(long nbyte)
Skips a given number of bytes forwards through the stream. |
Method Detail |
---|
byte readByte() throws IOException
IOException
short readShort() throws IOException
IOException
int readInt() throws IOException
IOException
long readLong() throws IOException
IOException
float readFloat() throws IOException
IOException
double readDouble() throws IOException
IOException
void skip(long nbyte) throws IOException
nbyte
- number of bytes to skip
IOException
void close() throws IOException
IOException
boolean isRandom()
void seek(long offset) throws IOException
UnsupportedOperationException
- if not random-access
IOException
long getOffset()
UnsupportedOperationException
- if not random-access
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |