public abstract class AbstractWritableBlob extends Object implements WritableBlob
WritableBlob
interface that implements
WritableBlob.readFrom(InputStream)
using WritableBlob.getOutputStream()
and
Blob.writeTo(OutputStream)
using Blob.getInputStream()
.Constructor and Description |
---|
AbstractWritableBlob() |
Modifier and Type | Method and Description |
---|---|
long |
readFrom(InputStream in)
Read data from the given input stream and write it to the blob.
|
void |
writeTo(OutputStream out)
Write the data to a given output stream.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getOutputStream, release
getInputStream, getSize
public long readFrom(InputStream in) throws StreamCopyException
WritableBlob
A call to this method has the same effect as requesting an output stream using
WritableBlob.getOutputStream()
and copying the data from the input stream to that
output stream, but the implementation may achieve this result in a more efficient way.
The blob must be in state NEW when this method is called. It will be in state COMMITTED after this method completes successfully.
The method transfers data from the input stream to the blob until the end of the input stream is reached.
readFrom
in interface WritableBlob
in
- An input stream to read data from. This method will not
close the stream.StreamCopyException
public void writeTo(OutputStream out) throws StreamCopyException
Blob
writeTo
in interface Blob
out
- The output stream to write the data to. This method will not close the stream.StreamCopyException
- Thrown if there is an I/O when reading the data from the blob or when writing it
to the stream. StreamCopyException.getOperation()
can be used to
determine whether the failed operation was a read or a write.Copyright © The Apache Software Foundation. All Rights Reserved.