edu.sdsc.grid.io
Class RemoteFileOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by edu.sdsc.grid.io.GeneralFileOutputStream
          extended by edu.sdsc.grid.io.RemoteFileOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable
Direct Known Subclasses:
IRODSFileOutputStream, SRBFileOutputStream

public abstract class RemoteFileOutputStream
extends GeneralFileOutputStream

A RemoteFileOutputStream writes bytes to a file in a file system. What files are available depends on the host environment.

RemoteFileOutputStream is meant for writing streams of raw bytes such as image data.

Since:
JARGON1.4

Field Summary
 
Fields inherited from class edu.sdsc.grid.io.GeneralFileOutputStream
fd
 
Constructor Summary
RemoteFileOutputStream(GeneralFile file)
          Creates a FileInputStream by opening a connection to an actual file, the file named by the File object file in the file system.
RemoteFileOutputStream(GeneralFileSystem fileSystem, java.lang.String name)
          Creates a FileOuputStream 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.GeneralFileOutputStream
close, finalize, open, write, write, write
 
Methods inherited from class java.io.OutputStream
flush
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteFileOutputStream

public RemoteFileOutputStream(GeneralFileSystem fileSystem,
                              java.lang.String name)
                       throws java.io.IOException
Creates a FileOuputStream by opening a connection to an actual file, the file named by the path name name in the file system.

First, the security is checked to verify the file can be written.

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.

RemoteFileOutputStream

public RemoteFileOutputStream(GeneralFile file)
                       throws java.io.IOException
Creates a FileInputStream 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, the security is checked to verify the file can be written.

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()