Package oracle.nosql.driver.values
Class BinaryValue
java.lang.Object
oracle.nosql.driver.values.FieldValue
oracle.nosql.driver.values.BinaryValue
- All Implemented Interfaces:
- Comparable<FieldValue>
A 
FieldValue instance representing a binary value. Instances of
 BinaryValue are only created by construction or returned by data operations.
 They will never be directly created by parsing JSON. On input a Base64
 encoded string can be accepted as a binary type if the database type is
 binary for the field. When represented as JSON this object is encoded
 as Base64 using encodeBase64(byte[]).- 
Nested Class SummaryNested classes/interfaces inherited from class oracle.nosql.driver.values.FieldValueFieldValue.Type
- 
Constructor SummaryConstructorsConstructorDescriptionBinaryValue(byte[] value) Creates a new instance.BinaryValue(String value) Creates a new instance from a Base64 encoded string.
- 
Method SummaryModifier and TypeMethodDescriptionintcompareTo(FieldValue other) Returns 0 if the two values are equal in terms of length and byte content, otherwise it returns -1.static byte[]decodeBase64(String binString) Decode the specified Base64 string into a byte array.static StringencodeBase64(byte[] buffer) Encode the specified byte array into a Base64 encoded string.booleangetType()Returns the type of the objectbyte[]getValue()Returns the binary value of this objectinthashCode()toJson(JsonOptions options) Returns a quoted string of the value as Base64.Methods inherited from class oracle.nosql.driver.values.FieldValueasArray, asBinary, asBoolean, asDouble, asInteger, asJsonNull, asLong, asMap, asNull, asNumber, asString, asTimestamp, castAsDouble, createFromJson, createFromJson, createFromJson, getBinary, getBoolean, getDouble, getInt, getLong, getNumber, getSerializedSize, getString, getTimestamp, isAnyNull, isArray, isAtomic, isBinary, isBoolean, isDouble, isInteger, isJsonNull, isLong, isMap, isNull, isNumber, isNumeric, isString, isTimestamp, toJson, toString
- 
Constructor Details- 
BinaryValuepublic BinaryValue(byte[] value) Creates a new instance.- Parameters:
- value- the value to use
 
- 
BinaryValueCreates a new instance from a Base64 encoded string.- Parameters:
- value- the value to use
- Throws:
- IllegalArgumentException- if the value is not a valid Base64 encoded value.
 
 
- 
- 
Method Details- 
getTypeDescription copied from class:FieldValueReturns the type of the object- Specified by:
- getTypein class- FieldValue
- Returns:
- the type
 
- 
getValuepublic byte[] getValue()Returns the binary value of this object- Returns:
- the binary value
 
- 
compareToReturns 0 if the two values are equal in terms of length and byte content, otherwise it returns -1.
- 
toJsonReturns a quoted string of the value as Base64.- Overrides:
- toJsonin class- FieldValue
- Parameters:
- options- configurable options used to affect the JSON output format of some data types. May be null.
- Returns:
- a quoted, Base64-encoded string encoded using
 encodeBase64(byte[]).
 
- 
equals
- 
hashCodepublic int hashCode()
- 
encodeBase64Encode the specified byte array into a Base64 encoded string. This string can be decoded usingdecodeBase64(java.lang.String).- Parameters:
- buffer- the input buffer
- Returns:
- the encoded string
 
- 
decodeBase64Decode the specified Base64 string into a byte array. The string must have been encoded usingencodeBase64(byte[])or the same algorithm.- Parameters:
- binString- the encoded input string
- Returns:
- the decoded array
- Throws:
- IllegalArgumentException- if the value is not a valid Base64 encoded value.
 
 
-