Package nom.tam.util
Interface ReadWriteAccess
- All Superinterfaces:
- InputReader,- OutputWriter
- All Known Subinterfaces:
- RandomAccess,- RandomAccessFileIO
- All Known Implementing Classes:
- BufferedFile,- ByteArrayIO,- FitsFile,- RandomAccessFileChannel
Interface for basic random access read and write operations. Because it is
 built on the elements used by 
FitsEncoder and FitsDecoder, in
 principle it can serve as the common point for reading and writing FITS
 binary data in memory (using ByteArrayIO) or in a file (using
 FitsFile or a subclass thereof). For that reason, addressing is
 assumed as 64-bit long type.- Since:
- 1.16
- Author:
- Attila Kovacs
- 
Method SummaryModifier and TypeMethodDescriptionlonglength()Returns the current total length of this instance, that is the total number of bytes that may be read from it.longposition()Returns the current read/write position in this instance.voidposition(long n) Sets a new position for the next read or write in this instance.Methods inherited from interface nom.tam.util.InputReaderread, readMethods inherited from interface nom.tam.util.OutputWriterwrite, write
- 
Method Details- 
positionReturns 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.- Returns:
- the current read/write position.
- Throws:
- IOException- if there was an IO error.
- See Also:
 
- 
positionSets 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.- Parameters:
- n- the new read/write position.
- Throws:
- IOException- if there was an IO error.
- See Also:
 
- 
lengthReturns the current total length of this instance, that is the total number of bytes that may be read from it.- Returns:
- the total number of bytes contained in this instance
- Throws:
- IOException- if there was an IO error.
 
 
-