org.ogf.saga.file
Class FileInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.ogf.saga.file.FileInputStream
All Implemented Interfaces:
Closeable, Cloneable, SagaObject, Async

public abstract class FileInputStream
extends InputStream
implements SagaObject, Async

Since Java programmers are used to streams, the Java language bindings of SAGA provide them. In contrast to everything else in the language bindings, this is an abstract class, not an interface, because it is supposed to be a java.io.InputStream (which is a class, not an interface). Implementations should redefine methods of java.io.InputStream.


Field Summary
 
Fields inherited from interface org.ogf.saga.SagaObject
NO_WAIT, WAIT_FOREVER
 
Constructor Summary
FileInputStream()
           
 
Method Summary
abstract  Task<FileInputStream,Integer> available(TaskMode mode)
          Creates a task that determines how many bytes are available from this stream.
 Object clone()
          Clone is mentioned here because the inherited Object.clone() cannot hide the public version in SagaObject.clone().
abstract  Task<FileInputStream,Void> close(TaskMode mode)
          Creates a task that closes this stream.
abstract  Task<FileInputStream,Void> mark(TaskMode mode, int readlimit)
          Creates a task that marks the current position in this stream.
abstract  Task<FileInputStream,Boolean> markSupported(TaskMode mode)
          Creates a task that determines if InputStream.mark(int) is supported.
abstract  Task<FileInputStream,Integer> read(TaskMode mode)
          Creates a task that reads a byte from this stream.
 Task<FileInputStream,Integer> read(TaskMode mode, byte[] buf)
          Creates a task that reads a buffer from this stream.
abstract  Task<FileInputStream,Integer> read(TaskMode mode, byte[] buf, int off, int len)
          Creates task that reads (part of) a buffer from this stream.
abstract  Task<FileInputStream,Void> reset(TaskMode mode)
          Creates a task that resets the position to the position last marked.
abstract  Task<FileInputStream,Long> skip(TaskMode mode, long n)
          Creates a task that skips the specified number of bytes from this stream.
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, read, read, reset, skip
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ogf.saga.SagaObject
getId, getSession
 

Constructor Detail

FileInputStream

public FileInputStream()
Method Detail

clone

public Object clone()
             throws CloneNotSupportedException
Clone is mentioned here because the inherited Object.clone() cannot hide the public version in SagaObject.clone().

Specified by:
clone in interface SagaObject
Overrides:
clone in class Object
Returns:
the clone.
Throws:
CloneNotSupportedException - when the clone method is not supported.

read

public abstract Task<FileInputStream,Integer> read(TaskMode mode)
                                            throws NotImplementedException
Creates a task that reads a byte from this stream. See InputStream.read().

Parameters:
mode - the task mode.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.

read

public abstract Task<FileInputStream,Integer> read(TaskMode mode,
                                                   byte[] buf,
                                                   int off,
                                                   int len)
                                            throws NotImplementedException
Creates task that reads (part of) a buffer from this stream. See InputStream.read(byte[], int, int).

Parameters:
mode - the task mode.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.

read

public Task<FileInputStream,Integer> read(TaskMode mode,
                                          byte[] buf)
                                   throws NotImplementedException
Creates a task that reads a buffer from this stream. See InputStream.read(byte[]).

Parameters:
mode - the task mode.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.

skip

public abstract Task<FileInputStream,Long> skip(TaskMode mode,
                                                long n)
                                         throws NotImplementedException
Creates a task that skips the specified number of bytes from this stream. See InputStream.skip(long).

Parameters:
mode - the task mode.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.

available

public abstract Task<FileInputStream,Integer> available(TaskMode mode)
                                                 throws NotImplementedException
Creates a task that determines how many bytes are available from this stream. See InputStream.available().

Parameters:
mode - the task mode.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.

close

public abstract Task<FileInputStream,Void> close(TaskMode mode)
                                          throws NotImplementedException
Creates a task that closes this stream. See InputStream.close().

Parameters:
mode - the task mode.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.

mark

public abstract Task<FileInputStream,Void> mark(TaskMode mode,
                                                int readlimit)
                                         throws NotImplementedException
Creates a task that marks the current position in this stream. See InputStream.mark(int).

Parameters:
mode - the task mode.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.

reset

public abstract Task<FileInputStream,Void> reset(TaskMode mode)
                                          throws NotImplementedException
Creates a task that resets the position to the position last marked. See InputStream.reset().

Parameters:
mode - the task mode.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.

markSupported

public abstract Task<FileInputStream,Boolean> markSupported(TaskMode mode)
                                                     throws NotImplementedException
Creates a task that determines if InputStream.mark(int) is supported. See InputStream.markSupported().

Parameters:
mode - the task mode.
Throws:
NotImplementedException - is thrown if the implementation does not provide an implementation of this method.


Copyright © 2014 Open Grid Forum. All rights reserved.