org.apache.manifoldcf.core.interfaces
Class BinaryInput

java.lang.Object
  extended by org.apache.manifoldcf.core.interfaces.BinaryInput
Direct Known Subclasses:
TempFileInput

public abstract class BinaryInput
extends java.lang.Object

This class represents a lightweight length-determined stream. It is used as a parameter in parameterized queries that use blobs. There are no implied semantics in this class around managing the stream itself. These semantics must be handled by a derived class.


Field Summary
static java.lang.String _rcsid
           
protected  long length
           
protected  java.io.InputStream stream
           
 
Constructor Summary
BinaryInput()
          Construct from nothing.
 
Method Summary
protected abstract  void calculateLength()
           
protected  void closeStream()
          Close the stream
 void discard()
          Discard the object
 void doneWithStream()
          Close the stream we passed to JDBC
 long getLength()
          Obtain the length to pass to JDBC
 java.io.InputStream getStream()
          Obtain the stream to pass to JDBC
protected abstract  void openStream()
           
abstract  BinaryInput transfer()
          Transfer to a new object; this causes the current object to become "already discarded"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_rcsid

public static final java.lang.String _rcsid
See Also:
Constant Field Values

stream

protected java.io.InputStream stream

length

protected long length
Constructor Detail

BinaryInput

public BinaryInput()
Construct from nothing.

Method Detail

getStream

public java.io.InputStream getStream()
                              throws ManifoldCFException
Obtain the stream to pass to JDBC

Throws:
ManifoldCFException

getLength

public long getLength()
               throws ManifoldCFException
Obtain the length to pass to JDBC

Throws:
ManifoldCFException

doneWithStream

public void doneWithStream()
                    throws ManifoldCFException
Close the stream we passed to JDBC

Throws:
ManifoldCFException

transfer

public abstract BinaryInput transfer()
Transfer to a new object; this causes the current object to become "already discarded"


discard

public void discard()
             throws ManifoldCFException
Discard the object

Throws:
ManifoldCFException

openStream

protected abstract void openStream()
                            throws ManifoldCFException
Throws:
ManifoldCFException

calculateLength

protected abstract void calculateLength()
                                 throws ManifoldCFException
Throws:
ManifoldCFException

closeStream

protected void closeStream()
                    throws ManifoldCFException
Close the stream

Throws:
ManifoldCFException