Class BinaryValue

  • All Implemented Interfaces:
    javax.jcr.Value

    public class BinaryValue
    extends BaseValue
    A BinaryValue provides an implementation of the Value interface representing a binary value.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int TYPE  
    • Constructor Summary

      Constructors 
      Constructor Description
      BinaryValue​(byte[] data)
      Constructs a BinaryValue object based on a byte array.
      BinaryValue​(java.io.InputStream stream)
      Constructs a BinaryValue object based on a stream.
      BinaryValue​(java.lang.String text)
      Constructs a BinaryValue object based on a string.
      BinaryValue​(javax.jcr.Binary bin)
      Constructs a BinaryValue object based on a Binary.
    • Constructor Detail

      • BinaryValue

        public BinaryValue​(java.lang.String text)
        Constructs a BinaryValue object based on a string.
        Parameters:
        text - the string this BinaryValue should represent
      • BinaryValue

        public BinaryValue​(javax.jcr.Binary bin)
        Constructs a BinaryValue object based on a Binary.
        Parameters:
        bin - the bytes this BinaryValue should represent
      • BinaryValue

        public BinaryValue​(java.io.InputStream stream)
        Constructs a BinaryValue object based on a stream.
        Parameters:
        stream - the stream this BinaryValue should represent
      • BinaryValue

        public BinaryValue​(byte[] data)
        Constructs a BinaryValue object based on a byte array.
        Parameters:
        data - the bytes this BinaryValue should represent
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object obj)
        Indicates whether some other object is "equal to" this one.

        The result is true if and only if the argument is not null and is a BinaryValue object that represents the same value as this object.

        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the reference object with which to compare.
        Returns:
        true if this object is the same as the obj argument; false otherwise.
      • hashCode

        public int hashCode()
        Returns zero to satisfy the Object equals/hashCode contract. This class is mutable and not meant to be used as a hash key.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        always zero
        See Also:
        Object.hashCode()
      • getInternalString

        public java.lang.String getInternalString()
                                           throws javax.jcr.ValueFormatException,
                                                  javax.jcr.RepositoryException
        Gets the string representation of this binary value.
        Returns:
        string representation of this binary value.
        Throws:
        javax.jcr.ValueFormatException
        javax.jcr.RepositoryException - if another error occurs
      • getStream

        public java.io.InputStream getStream()
                                      throws java.lang.IllegalStateException,
                                             javax.jcr.RepositoryException
        Specified by:
        getStream in interface javax.jcr.Value
        Overrides:
        getStream in class BaseValue
        Throws:
        java.lang.IllegalStateException
        javax.jcr.RepositoryException
      • getBinary

        public javax.jcr.Binary getBinary()
                                   throws javax.jcr.ValueFormatException,
                                          java.lang.IllegalStateException,
                                          javax.jcr.RepositoryException
        Specified by:
        getBinary in interface javax.jcr.Value
        Overrides:
        getBinary in class BaseValue
        Throws:
        javax.jcr.ValueFormatException
        java.lang.IllegalStateException
        javax.jcr.RepositoryException