public interface Blob
Blobs are thread safe in the sense that methods defined by this interface may be called
concurrently. In addition, two different threads can safely invoke methods on two different
InputStream
instances retrieved by getInputStream()
concurrently. However some
blobs (in particular WritableBlob
implementations) may define additional methods and
invoking these methods concurrently with methods defined by this interface is generally not
thread safe.
Modifier and Type | Method and Description |
---|---|
InputStream |
getInputStream()
Get an input stream to read the data in the blob.
|
long |
getSize()
Get the size of the blob.
|
void |
writeTo(OutputStream out)
Write the data to a given output stream.
|
InputStream getInputStream() throws IOException
InputStream
object is
returned each time this method is called, and the stream is positioned at the beginning of
the data.IOException
void writeTo(OutputStream out) throws StreamCopyException
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.long getSize()
Copyright © The Apache Software Foundation. All Rights Reserved.