edu.sdsc.grid.io
Class RemoteFileInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by edu.sdsc.grid.io.GeneralFileInputStream
          extended by edu.sdsc.grid.io.RemoteFileInputStream
All Implemented Interfaces:
java.io.Closeable
Direct Known Subclasses:
IRODSFileInputStream, SRBFileInputStream

public abstract class RemoteFileInputStream
extends GeneralFileInputStream

A GeneralFileInputStream obtains input bytes from a file in a file system. What files are available depends on the host environment.

GeneralFileInputStream is meant for reading streams of raw bytes such as image data.

The original intention for this class was to subclass java.io.FileInputStream. But that is not currently the case.

Since:
JARGON1.4

Field Summary
 
Fields inherited from class edu.sdsc.grid.io.GeneralFileInputStream
fd
 
Constructor Summary
RemoteFileInputStream(GeneralFile file)
          Creates a RemoteFileInputStream by opening a connection to an actual file, the file named by the File object file in the file system.
RemoteFileInputStream(GeneralFileSystem fileSystem, java.lang.String name)
          Creates a RemoteFileInputStream by opening a connection to an actual file, the file named by the path name name in the file system.
 
Method Summary
 
Methods inherited from class edu.sdsc.grid.io.GeneralFileInputStream
available, close, finalize, open, read, read, read, skip
 
Methods inherited from class java.io.InputStream
mark, markSupported, reset
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteFileInputStream

public RemoteFileInputStream(GeneralFileSystem fileSystem,
                             java.lang.String name)
                      throws java.io.IOException
Creates a RemoteFileInputStream by opening a connection to an actual file, the file named by the path name name in the file system. A new FileDescriptor object is created to represent this file connection.

First, if there is a security manager, its checkRead method is called with the name argument as its argument.

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 IOException is thrown.

Parameters:
name - the system-dependent file name.
Throws:
java.io.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.

RemoteFileInputStream

public RemoteFileInputStream(GeneralFile file)
                      throws java.io.IOException
Creates a RemoteFileInputStream by opening a connection to an actual file, the file named by the File object file in the file system. A new FileDescriptor object is created to represent this file connection.

First, if there is a security manager, its checkRead method is called with the path represented by the file argument as its argument.

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 IOException is thrown.

Parameters:
file - the file to be opened for reading.
Throws:
java.io.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.
See Also:
File.getPath()