public interface MemoryBlob extends WritableBlob
This interface redefines several methods from Blob
and WritableBlob
to not throw
IOException
. Also note that since data is stored in memory, calling
WritableBlob.release()
is not required.
Instances are created with Blobs.createMemoryBlob()
.
Modifier and Type | Method and Description |
---|---|
InputStream |
getInputStream()
Get an input stream to read the data in the blob.
|
OutputStream |
getOutputStream()
Create an output stream to write data to the blob.
|
long |
getSize()
Get the size of the blob.
|
InputStream |
readOnce()
Get an input stream that consumes the content of this blob.
|
void |
release()
Release all resources held by this blob.
|
readFrom
InputStream getInputStream()
Blob
InputStream
object is
returned each time this method is called, and the stream is positioned at the beginning of
the data.getInputStream
in interface Blob
OutputStream getOutputStream()
WritableBlob
Calls to methods of the returned output stream will modify the state of the blob according to the following rules:
OutputStream.close()
will change the state to COMMITTED.
IOException
if the state is COMMITTED, i.e. if the stream has already been
closed.
The returned stream may implement ReadFromSupport
, especially if the blob stores its
data in memory (in which case ReadFromSupport.readFrom(InputStream, long)
would read
data directly into the buffers managed by the blob).
getOutputStream
in interface WritableBlob
long getSize()
Blob
void release()
WritableBlob
release
in interface WritableBlob
InputStream readOnce()
Copyright © The Apache Software Foundation. All Rights Reserved.