Interface RandomAccess
- All Superinterfaces:
ArrayDataInput, AutoCloseable, Closeable, DataInput, FitsIO, InputReader, OutputWriter, ReadWriteAccess
- All Known Implementing Classes:
BufferedFile, FitsFile
Interface that combines file-based random acesss with high-throughput array IO
-
Field Summary
Fields inherited from interface FitsIO
BITS_OF_1_BYTE, BITS_OF_2_BYTES, BITS_OF_3_BYTES, BITS_OF_4_BYTES, BITS_OF_5_BYTES, BITS_OF_6_BYTES, BITS_OF_7_BYTES, BYTE_1_OF_LONG_MASK, BYTE_2_OF_LONG_MASK, BYTE_3_OF_LONG_MASK, BYTE_4_OF_LONG_MASK, BYTE_MASK, BYTES_IN_BOOLEAN, BYTES_IN_BYTE, BYTES_IN_CHAR, BYTES_IN_DOUBLE, BYTES_IN_FLOAT, BYTES_IN_INTEGER, BYTES_IN_LONG, BYTES_IN_SHORT, DEFAULT_BUFFER_SIZE, HIGH_INTEGER_MASK, INTEGER_MASK, SHORT_MASK, SHORT_OF_LONG_MASKModifier and TypeFieldDescriptionstatic final intnumber of bits in one byte.static final intnumber of bits in two byte.static final intnumber of bits in three byte.static final intnumber of bits in four byte.static final intnumber of bits in five byte.static final intnumber of bits in six byte.static final intnumber of bits in seven byte.static final longbit mask to get the lowest byte of a long.static final longbit mask to get the second lowest byte of a long.static final longbit mask to get the third lowest byte of a long.static final longbit mask to get the fourth lowest byte of a long.static final intbit mask to get the lowest byte from an integer.static final intnumber of bytes occupied by a boolean.static final intnumber of bytes occupied by a byte.static final intnumber of bytes occupied by a char.static final intnumber of bytes occupied by a double.static final intnumber of bytes occupied by a float.static final intnumber of bytes occupied by a integer.static final intnumber of bytes occupied by a long.static final intnumber of bytes occupied by a short.static final intdefault buffer size to use unless specified otherwise.static final longbit mask to get the highest integer from an long.static final longbit mask to get the lowest integer from an long.static final intbit mask to get the lowest short of a integer.static final longbit mask to get the lowest short of a long. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the current offset from the beginning of the input.default longposition()Returns the current read/write position in this instance.default voidposition(long pos) Sets a new position for the next read or write in this instance.voidseek(long offsetFromStart) Move to a specified location in the stream.Methods inherited from interface ArrayDataInput
mark, markSupported, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, read, readArray, readArrayFully, readFully, readImage, readLArray, reset, skip, skipAllBytes, skipAllBytesModifier and TypeMethodDescriptionvoidmark(int readlimit) See the general contract of themarkmethod ofInputStream.default booleanSee the general contract of themarkSupportedmethod ofInputStream.default intread(boolean[] buf) Read an array of boolean's.intread(boolean[] buf, int offset, int size) Read a segment of an array of boolean's.intread(byte[] buf) Read an array of byte's.default intread(char[] buf) Read an array of char's.intread(char[] buf, int offset, int size) Read a segment of an array of char's.default intread(double[] buf) Read an array of double's.intread(double[] buf, int offset, int size) Read a segment of an array of double's.default intread(float[] buf) Read an array of float's.intread(float[] buf, int offset, int size) Read a segment of an array of float's.default intread(int[] buf) Read an array of int's.intread(int[] buf, int offset, int size) Read a segment of an array of int's.default intread(long[] buf) Read a segment of an array of long's.intread(long[] buf, int offset, int size) Read a segment of an array of long's.default intread(short[] buf) Read an array of short's.intread(short[] buf, int offset, int size) Read a segment of an array of short's.default intRead an array of booleans, possibly including legalnullvalues.default intReads into an array of booleans, possibly including legalnullvalues.default intDeprecated.default voidReads a Java array from the input, populating all elements, or else throwing andEOFException.voidreadFully(byte[] b, int off, int len) default voidLikeArrayDataInput.readArrayFully(Object)but strictly for numerical types only.longreadLArray(Object o) Reads a Java array from the input, translating it from its binary representation to Java data format.voidreset()See the general contract of theresetmethod ofInputStream.longskip(long distance) Skip the number of bytes.default voidskipAllBytes(int toSkip) Deprecated.This call is handled byArrayDataInput.skipAllBytes(long), without the need for a separate implementation.voidskipAllBytes(long toSkip) Skips a number of bytes from the input.Methods inherited from interface DataInput
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytesMethods inherited from interface InputReader
read, readMethods inherited from interface OutputWriter
write, writeMethods inherited from interface ReadWriteAccess
lengthModifier and TypeMethodDescriptionlonglength()Returns the current total length of this instance, that is the total number of bytes that may be read from it.
-
Method Details
-
getFilePointer
long getFilePointer()Returns the current offset from the beginning of the input.- Returns:
- the current position in the stream.
-
seek
Move to a specified location in the stream.- Parameters:
offsetFromStart- set the offset messured from the start- Throws:
IOException- if the operation fails
-
position
Description copied from interface:ReadWriteAccessReturns the current read/write position in this instance. The position may exceed the length, depending on implementation, just asseekmay go beyond the file size inRandomAccessFile.- Specified by:
positionin interfaceReadWriteAccess- Returns:
- the current read/write position.
- Throws:
IOException- if there was an IO error.- See Also:
-
position
Description copied from interface:ReadWriteAccessSets a new position for the next read or write in this instance. The position may exceed the length, depending on implementation, just asseekmay go beyond the file size inRandomAccessFile.- Specified by:
positionin interfaceReadWriteAccess- Parameters:
pos- the new read/write position.- Throws:
IOException- if there was an IO error.- See Also:
-
ArrayDataInput.readLArray(Object)instead.