Package org.apache.axiom.util.blob
Class BlobOutputStream
- java.lang.Object
-
- java.io.OutputStream
-
- org.apache.axiom.util.blob.BlobOutputStream
-
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,ReadFromSupport
public abstract class BlobOutputStream extends OutputStream implements ReadFromSupport
Output stream that is used to write to a blob. Instances of this class are returned by theWritableBlob.getOutputStream()method.
-
-
Constructor Summary
Constructors Constructor Description BlobOutputStream()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract WritableBlobgetBlob()Get the blob to which this output stream belongs.longreadFrom(InputStream inputStream, long length)Read data from the given input stream and write it to this output stream.-
Methods inherited from class java.io.OutputStream
close, flush, nullOutputStream, write, write, write
-
-
-
-
Method Detail
-
getBlob
public abstract WritableBlob getBlob()
Get the blob to which this output stream belongs.- Returns:
- the blob
-
readFrom
public long readFrom(InputStream inputStream, long length) throws StreamCopyException
Description copied from interface:ReadFromSupportRead data from the given input stream and write it to this output stream. The method transfers data until one of the following conditions is met:- The end of the input stream is reached.
- The value of the
lengthargument is different from-1and the number of bytes transferred is equal tolength.
- Specified by:
readFromin interfaceReadFromSupport- Parameters:
inputStream- An input stream to read data from. This method will not close the stream.length- the number of bytes to transfer, or-1if the method should transfer data until the end of the input stream is reached- Returns:
- the number of bytes transferred
- Throws:
StreamCopyException
-
-