Class RemoteRandomAccessFile

java.lang.Object
ucar.unidata.io.RandomAccessFile
ucar.unidata.io.RemoteRandomAccessFile
All Implemented Interfaces:
Closeable, DataInput, DataOutput, AutoCloseable, ucar.nc2.util.cache.FileCacheable, ReadableRemoteFile

public abstract class RemoteRandomAccessFile extends RandomAccessFile implements ReadableRemoteFile
An abstract superclass for remote RandomAccessFile
  • Method Details

    • readToByteChannel

      public long readToByteChannel(WritableByteChannel dest, long offset, long nbytes) throws IOException
      Description copied from class: RandomAccessFile
      Read nbytes bytes, at the specified file offset, send to a WritableByteChannel. This will block until all bytes are read. This uses the underlying file channel directly, bypassing all user buffers.
      Overrides:
      readToByteChannel in class RandomAccessFile
      Parameters:
      dest - write to this WritableByteChannel.
      offset - the offset in the file where copying will start.
      nbytes - the number of bytes to read.
      Returns:
      the actual number of bytes read and transfered
      Throws:
      IOException - if an I/O error occurs.
    • close

      public void close() throws IOException
      Description copied from class: RandomAccessFile
      Close the file, and release any associated system resources.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface ucar.nc2.util.cache.FileCacheable
      Overrides:
      close in class RandomAccessFile
      Throws:
      IOException - if an I/O error occurrs.