public class BinaryBlob extends AbstractBlob implements ManagedBlob, Serializable
| Modifier and Type | Field and Description | 
|---|---|
protected Binary | 
binary  | 
protected String | 
key
The key, which is the binary's digest but may in addition be prefixed by a blob provider id. 
 | 
protected long | 
length  | 
digest, encoding, filename, mimeType, TEXT_PLAIN, UTF_8| Constructor and Description | 
|---|
BinaryBlob(Binary binary,
          String key,
          String filename,
          String mimeType,
          String encoding,
          String digest,
          long length)  | 
| Modifier and Type | Method and Description | 
|---|---|
protected boolean | 
equalsStream(Blob blob)  | 
Binary | 
getBinary()
Gets the  
Binary attached to this blob. | 
String | 
getDigest()  | 
String | 
getDigestAlgorithm()  | 
File | 
getFile()
If this blob is backed by an actual file, returns it. 
 | 
String | 
getKey()
Gets the stored representation of this blob. 
 | 
long | 
getLength()
Gets the data length in bytes if known. 
 | 
String | 
getProviderId()
Gets the id of the  
BlobProvider managing this blob. | 
InputStream | 
getStream()
Gets an  
InputStream for the data of this blob. | 
equals, getByteArray, getCloseableFile, getCloseableFile, getEncoding, getFilename, getMimeType, getString, hashCode, setDigest, setEncoding, setFilename, setMimeType, transferTo, transferToclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetByteArray, getCloseableFile, getCloseableFile, getEncoding, getFilename, getMimeType, getString, setDigest, setEncoding, setFilename, setMimeType, transferTo, transferToprotected final String key
protected final long length
public long getLength()
BlobgetLength in interface BlobgetLength in class AbstractBlobpublic InputStream getStream() throws IOException
BlobInputStream for the data of this blob.
 
 The contract of Blob is that this method can be called several times and will correctly return a new
 InputStream each time. In other words, several reads of the Blob can be done.
 
 Like all InputStream, the result must be closed when done with it to avoid resource leaks.
getStream in interface BlobIOExceptionpublic Binary getBinary()
Binary attached to this blob.public String getDigestAlgorithm()
getDigestAlgorithm in interface BlobgetDigestAlgorithm in class AbstractBlobpublic String getDigest()
getDigest in interface BlobgetDigest in class AbstractBlobpublic String getKey()
ManagedBlobgetKey in interface ManagedBlobpublic String getProviderId()
ManagedBlobBlobProvider managing this blob.getProviderId in interface ManagedBlobpublic File getFile()
BlobThe returned file may be short-lived (temporary), so should be used immediately.
getFile in interface BlobgetFile in class AbstractBlobnull if the blob is not backed by a fileprotected boolean equalsStream(Blob blob)
equalsStream in class AbstractBlobCopyright © 2019 Nuxeo. All rights reserved.