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.
|
readFromInputStream getInputStream()
BlobInputStream object is
returned each time this method is called, and the stream is positioned at the beginning of
the data.getInputStream in interface BlobOutputStream getOutputStream()
WritableBlobCalls 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 WritableBloblong getSize()
Blobvoid release()
WritableBlobrelease in interface WritableBlobInputStream readOnce()
Copyright © The Apache Software Foundation. All Rights Reserved.