Class BinaryInput
- java.lang.Object
-
- org.apache.manifoldcf.core.interfaces.PersistentDatabaseObject
-
- org.apache.manifoldcf.core.interfaces.BinaryInput
-
- Direct Known Subclasses:
TempFileInput
public abstract class BinaryInput extends PersistentDatabaseObject
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.
-
-
Constructor Summary
Constructors Constructor Description BinaryInput()Construct from nothing.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidcalculateLength()protected voidcloseStream()Close the streamvoiddiscard()Discard the objectvoiddoneWithStream()Close the stream we passed to JDBClonggetLength()Obtain the length to pass to JDBCjava.io.InputStreamgetStream()Obtain the stream to pass to JDBCprotected static voidhandleIOException(java.io.IOException e, java.lang.String context)protected abstract voidopenStream()abstract BinaryInputtransfer()Transfer to a new object; this causes the current object to become "already discarded"
-
-
-
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
-
-
Method Detail
-
getStream
public java.io.InputStream getStream() throws ManifoldCFExceptionObtain the stream to pass to JDBC- Throws:
ManifoldCFException
-
getLength
public long getLength() throws ManifoldCFExceptionObtain the length to pass to JDBC- Throws:
ManifoldCFException
-
doneWithStream
public void doneWithStream() throws ManifoldCFExceptionClose the stream we passed to JDBC- Specified by:
doneWithStreamin classPersistentDatabaseObject- 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 ManifoldCFExceptionDiscard the object- Specified by:
discardin classPersistentDatabaseObject- 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 ManifoldCFExceptionClose the stream- Throws:
ManifoldCFException
-
handleIOException
protected static void handleIOException(java.io.IOException e, java.lang.String context) throws ManifoldCFException- Throws:
ManifoldCFException
-
-