Package org.apache.jackrabbit.value
Class BinaryValue
java.lang.Object
org.apache.jackrabbit.value.BaseValue
org.apache.jackrabbit.value.BinaryValue
- All Implemented Interfaces:
Value
A
BinaryValue provides an implementation
of the Value interface representing a binary value.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBinaryValue(byte[] data) Constructs aBinaryValueobject based on a byte array.BinaryValue(InputStream stream) Constructs aBinaryValueobject based on a stream.BinaryValue(String text) Constructs aBinaryValueobject based on a string.BinaryValue(Binary bin) Constructs aBinaryValueobject based on aBinary. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.Returns aBinaryrepresentation of this value.Gets the string representation of this binary value.Returns anInputStreamrepresentation of this value.inthashCode()Returns zero to satisfy the Object equals/hashCode contract.Methods inherited from class org.apache.jackrabbit.value.BaseValue
getBoolean, getDate, getDecimal, getDouble, getLong, getString, getType
-
Field Details
-
TYPE
public static final int TYPE- See Also:
-
-
Constructor Details
-
BinaryValue
Constructs aBinaryValueobject based on a string.- Parameters:
text- the string thisBinaryValueshould represent
-
BinaryValue
Constructs aBinaryValueobject based on aBinary.- Parameters:
bin- the bytes thisBinaryValueshould represent
-
BinaryValue
Constructs aBinaryValueobject based on a stream.- Parameters:
stream- the stream thisBinaryValueshould represent
-
BinaryValue
public BinaryValue(byte[] data) Constructs aBinaryValueobject based on a byte array.- Parameters:
data- the bytes thisBinaryValueshould represent
-
-
Method Details
-
equals
Indicates whether some other object is "equal to" this one.The result is
trueif and only if the argument is notnulland is aBinaryValueobject that represents the same value as this object. -
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. -
getInternalString
Gets the string representation of this binary value.- Returns:
- string representation of this binary value.
- Throws:
ValueFormatExceptionRepositoryException- if another error occurs
-
getStream
Returns anInputStreamrepresentation of this value. Uses the standard conversion to binary (see JCR specification).It is the responsibility of the caller to close the returned
InputStream.- Specified by:
getStreamin interfaceValue- Overrides:
getStreamin classBaseValue- Returns:
- An
InputStreamrepresentation of this value. - Throws:
RepositoryException- if an error occurs.IllegalStateException
-
getBinary
Returns aBinaryrepresentation of this value. TheBinaryobject in turn provides methods to access the binary data itself. Uses the standard conversion to binary (see JCR specification).- Specified by:
getBinaryin interfaceValue- Overrides:
getBinaryin classBaseValue- Returns:
- A
Binaryrepresentation of this value. - Throws:
RepositoryException- if an error occurs.ValueFormatExceptionIllegalStateException
-