Interface RandomAccessFileIO

All Superinterfaces:
AutoCloseable, Closeable, InputReader, OutputWriter, ReadWriteAccess
All Known Implementing Classes:
RandomAccessFileChannel

public interface RandomAccessFileIO extends ReadWriteAccess, Closeable
Interface for IO objects that support file-like random access. The methods defined here are those used by FitsFile to access a RandomAccessFile. The RandomAccessFileExt class adds this interface to RandomAccessFile, but other systems could provide an alternate implementation of this interface to access an arbitrary FITS data object.
Author:
pdowler
  • Method Summary

    Modifier and Type
    Method
    Description
    Obtain the current FileChannel instance.
    Obtain the current FileDescriptor instance.
    default int
    read(byte[] bytes)
    Reads data, fully populating the supplied array.
    See RandomAccessFile.readUTF() for a contract of this method.
    void
    setLength(long length)
    See RandomAccessFile.setLength(long) for a contract of this method.
    default void
    write(byte[] bytes)
    Write all data from the the supplied array.
    void
    See RandomAccessFile.writeUTF(String) for a contract of this method.

    Methods inherited from interface Closeable

    close

    Methods inherited from interface InputReader

    read, read
    Modifier and Type
    Method
    Description
    int
    Reads a byte.
    int
    read(byte[] b, int from, int length)
    Reads up to the specified number of bytes into a buffer.

    Methods inherited from interface OutputWriter

    write, write
    Modifier and Type
    Method
    Description
    void
    write(byte[] b, int from, int length)
    Writes up to the specified number of bytes from a buffer to the stream.
    void
    write(int b)
    Writes a byte.

    Methods inherited from interface ReadWriteAccess

    length, position, position
    Modifier and Type
    Method
    Description
    long
    Returns the current total length of this instance, that is the total number of bytes that may be read from it.
    long
    Returns the current read/write position in this instance.
    void
    position(long n)
    Sets a new position for the next read or write in this instance.