Package org.apache.axiom.util.blob
Interface Blob
-
- All Known Subinterfaces:
WritableBlob
- All Known Implementing Classes:
MemoryBlob,OverflowBlob
public interface BlobStores binary data.Not that blobs are not thread safe. While they support requesting multiple concurrent input streams, these streams must be used in the same thread, unless appropriate synchronization or locking is done.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description InputStreamgetInputStream()Get an input stream to read the data in the blob.longgetLength()Get the length of the data in the blob, i.e.voidwriteTo(OutputStream out)Write the data to a given output stream.
-
-
-
Method Detail
-
getInputStream
InputStream getInputStream() throws IOException
Get an input stream to read the data in the blob.- Returns:
- the input stream to read the data from
- Throws:
IOException
-
writeTo
void writeTo(OutputStream out) throws StreamCopyException
Write the data to a given output stream.- Parameters:
out- The output stream to write the data to. This method will not close the stream.- Throws:
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.
-
getLength
long getLength()
Get the length of the data in the blob, i.e. the number of bytes.- Returns:
- the length of the data in the blob
-
-