Class BinaryBasedBlob
java.lang.Object
org.apache.jackrabbit.oak.plugins.value.BinaryBasedBlob
- All Implemented Interfaces:
Blob
This Blob implementation is based on an underlying
Binary.
Any error accessing the underlying binary in getNewStream() will be
deferred to the returned input stream.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionA unique identifier of the content of this value.@NotNull InputStreamDelegates toBinary.getStream()and returns an input stream the always throws anIOExceptionif the underlying binary failed to produce one.Returns a secure reference to this blob, ornullif such a reference is not available.longlength()Delegates toBinary.getSize()and returns -1 if that fails.
-
Constructor Details
-
BinaryBasedBlob
-
-
Method Details
-
getNewStream
Delegates toBinary.getStream()and returns an input stream the always throws anIOExceptionif the underlying binary failed to produce one.- Specified by:
getNewStreamin interfaceBlob- Returns:
- a new stream for this blob
-
length
public long length()Delegates toBinary.getSize()and returns -1 if that fails. -
getReference
Description copied from interface:BlobReturns a secure reference to this blob, ornullif such a reference is not available.- Specified by:
getReferencein interfaceBlob- Returns:
null- See Also:
-
getContentIdentity
Description copied from interface:BlobA unique identifier of the content of this value. Usually this is a message digest of the content (a cryptographically secure one-way hash). This allows to avoid processing large binary values multiple times.This method returns null if the identifier is unknown. The identifier may not always be available, for example if the value has not yet been saved or processed. Once an identifier is available, it will never change because values are immutable.
If two values have the same identifier, the content of the value is guaranteed to be the same. However it is not guaranteed that two values with the same content will return the same identifier.
The identifier is opaque, meaning it can have any format and size.
- Specified by:
getContentIdentityin interfaceBlob- Returns:
null
-