public interface BinaryDataType extends DataType<Binary>
Binary
values can be used to store and transmit arbitrary
information. The responsibility for formatting and interpreting the
information belongs solely to the application. Before using Binary for a
topic, consider other data types such as JSON
or single value topic
types; these may provide a simpler interface for your application.
The implementation provides support for binary
deltas
.
DataTypes.binary()
Modifier and Type | Method and Description |
---|---|
DeltaType<Binary,BinaryDelta> |
binaryDeltaType()
Returns support for binary deltas.
|
Binary |
readValue(byte[] in)
Create a value from binary.
|
Binary |
readValue(byte[] in,
int offset,
int length)
Create a value from binary.
|
deltaType, deltaType, getTypeName, readValue, validate, writeValue
DeltaType<Binary,BinaryDelta> binaryDeltaType()
Equivalent to calling deltaType(BinaryDelta.class)
.
Binary readValue(byte[] in, int offset, int length) throws IndexOutOfBoundsException
Implementations can choose not to fully validate values when they are
read, but instead defer parsing until it is required. See
DataType.validate(Object)
.
There are no invalid Binary instances, so this method does not throw
InvalidDataException
.
readValue
in interface DataType<Binary>
in
- the binary data. The implementation re-uses the array to avoid
copying. The caller must ensure the array is not modified.offset
- start of the data within byteslength
- length of the data within bytesIndexOutOfBoundsException
- if either offset
or
length
is negative, or
offset + length > bytes.length
Binary readValue(byte[] in)
DataType
readValue(in, 0, in.length)
.Copyright © 2016 Push Technology Ltd. All Rights Reserved.