public class StorageBlob extends DefaultStreamBlob implements SQLBlob
EMPTY_BYTE_ARRAY, EMPTY_INPUT_STREAM, EMPTY_READER, EMPTY_STRING
Constructor and Description |
---|
StorageBlob(Binary binary,
String filename,
String mimeType,
String encoding,
String digest,
long length) |
Modifier and Type | Method and Description |
---|---|
Binary |
getBinary()
Gets the
Binary attached to this blob. |
String |
getDigest() |
long |
getLength()
Gets the data length in bytes if known.
|
InputStream |
getStream() |
boolean |
isPersistent()
Checks whether this blob is persistent.
|
Blob |
persist()
Persist this stream so that
Blob.getStream() method can be called
successfully several times. |
getEncoding, getFilename, getMimeType, setDigest, setEncoding, setFilename, setMimeType
asByteArrayBlob, asStringBlob, getByteArray, getReader, getString, readBytes, readBytes, readString
copy, copy, equals, hashCode, transferTo, transferTo, transferTo
getClass, notify, notifyAll, toString, wait, wait, wait
getByteArray, getEncoding, getFilename, getMimeType, getReader, getString, setDigest, setEncoding, setFilename, setMimeType, transferTo, transferTo, transferTo
public long getLength()
Blob
getLength
in interface Blob
getLength
in class StreamBlob
public InputStream getStream() throws IOException
getStream
in interface Blob
IOException
public boolean isPersistent()
Blob
Blob.getStream()
can be
successfully called several times).isPersistent
in interface Blob
public Blob persist()
Blob
Blob.getStream()
method can be called
successfully several times. The persistence is done in a temporary file
or in memory - this is up to the implementation.
Blobs that are already persistent return themselves.
Persistence should update the internal structure of the Blob to make it persistent whenever possible and hence return itself whenever possible. This behavior cannot be guaranteed by every implementation however.
public Binary getBinary()
SQLBlob
Binary
attached to this blob.public String getDigest()
getDigest
in interface Blob
getDigest
in class DefaultStreamBlob
Copyright © 2014 Nuxeo SA. All rights reserved.