Class NfsFileInputStream

java.lang.Object
java.io.InputStream
com.emc.ecs.nfsclient.nfs.io.NfsFileInputStream
All Implemented Interfaces:
Closeable, AutoCloseable

public class NfsFileInputStream extends InputStream
The NFS equivalent of java.io.FileInputStream.
  • Field Details

  • Constructor Details

    • NfsFileInputStream

      public NfsFileInputStream(NfsFile<?,?> nfsFile, long offset, int maximumBufferSize) throws IOException
      Creates a NfsFileInputStream by opening a connection to an actual NFS file, using the specified offset and maximumBufferSize.

      If the named file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading then a FileNotFoundException is thrown.

      Parameters:
      nfsFile - The NFS file instance to be read.
      offset - The offset at which reading should start, in bytes.
      maximumBufferSize - The maximum buffer size to use in bytes.
      Throws:
      IOException - If the file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading.
    • NfsFileInputStream

      public NfsFileInputStream(NfsFile<?,?> nfsFile, int maximumBufferSize) throws IOException
      Creates a NfsFileInputStream by opening a connection to an actual NFS file, starting to read at offset 0 and using the specified maximum buffer size.

      If the named file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading then a FileNotFoundException is thrown.

      Parameters:
      nfsFile - The NFS file instance to be read.
      maximumBufferSize - The maximum buffer size to use in bytes.
      Throws:
      IOException - If the file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading.
    • NfsFileInputStream

      public NfsFileInputStream(NfsFile<?,?> nfsFile) throws IOException
      Creates a NfsFileInputStream by opening a connection to an actual NFS file, starting to read at offset 0 and using the preferred buffer size as the maximums. This constructor will generally give you the best performance.

      If the named file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading then a FileNotFoundException is thrown.

      Parameters:
      nfsFile - The NFS file instance to be read.
      Throws:
      IOException - If the file does not exist, is a directory rather than a regular file, or for some other reason cannot be opened for reading.
  • Method Details