Class BinaryBlob

    • Field Detail

      • binary

        protected final Binary binary
      • key

        protected final String key
        The key, which is the binary's digest but may in addition be prefixed by a blob provider id.
      • length

        protected final long length
    • Method Detail

      • getLength

        public long getLength()
        Description copied from interface: Blob
        Gets the data length in bytes if known.
        Specified by:
        getLength in interface Blob
        Overrides:
        getLength in class AbstractBlob
        Returns:
        the data length or -1 if not known
      • getStream

        public InputStream getStream()
                              throws IOException
        Description copied from interface: Blob
        Gets an InputStream 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.

        Specified by:
        getStream in interface Blob
        Specified by:
        getStream in interface ManagedBlob
        Returns:
        the stream
        Throws:
        IOException
      • getBinary

        public Binary getBinary()
        Gets the Binary attached to this blob.
        Returns:
        the binary
        Since:
        5.9.4
      • getKey

        public String getKey()
        Description copied from interface: ManagedBlob
        Gets the stored representation of this blob.
        Specified by:
        getKey in interface ManagedBlob
        Returns:
        the stored representation
      • getFile

        public File getFile()
        Description copied from interface: Blob
        If this blob is backed by an actual file, returns it.

        The returned file may be short-lived (temporary), so should be used immediately.

        Specified by:
        getFile in interface Blob
        Specified by:
        getFile in interface ManagedBlob
        Overrides:
        getFile in class AbstractBlob
        Returns:
        a file, or null if the blob is not backed by a file