T
- the java type of the raw value.@Internal public final class BinaryRawValueData<T> extends LazyBinaryFormat<T> implements RawValueData<T>
RawValueData
which is backed by MemorySegment
s
and generic Object
.
Either MemorySegment
s or Object
must be provided when constructing BinaryRawValueData
. The other representation will be materialized when needed.
HIGHEST_FIRST_BIT, HIGHEST_SECOND_TO_EIGHTH_BIT, MAX_FIX_PART_DATA_SIZE
Constructor and Description |
---|
BinaryRawValueData(MemorySegment[] segments,
int offset,
int sizeInBytes) |
BinaryRawValueData(MemorySegment[] segments,
int offset,
int sizeInBytes,
T javaObject) |
BinaryRawValueData(T javaObject) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
static <T> BinaryRawValueData<T> |
fromBytes(byte[] bytes)
Creates a
BinaryStringData instance from the given bytes. |
static <T> BinaryRawValueData<T> |
fromBytes(byte[] bytes,
int offset,
int numBytes)
Creates a
BinaryStringData instance from the given bytes with offset and number of
bytes. |
static <T> BinaryRawValueData<T> |
fromObject(T javaObject)
Creates a
BinaryRawValueData instance from the given Java object. |
int |
hashCode() |
protected BinarySection |
materialize(TypeSerializer<T> serializer)
Materialize java object to binary format.
|
byte[] |
toBytes(TypeSerializer<T> serializer)
Converts this
RawValueData into a byte array. |
T |
toObject(TypeSerializer<T> serializer)
Converts this
RawValueData into a Java object. |
String |
toString() |
ensureMaterialized, getBinarySection, getJavaObject, getOffset, getSegments, getSizeInBytes, setJavaObject
public BinaryRawValueData(T javaObject)
public BinaryRawValueData(MemorySegment[] segments, int offset, int sizeInBytes)
public BinaryRawValueData(MemorySegment[] segments, int offset, int sizeInBytes, T javaObject)
public T toObject(TypeSerializer<T> serializer)
RawValueData
RawValueData
into a Java object.
The given serializer is required because the "raw value" might be represented in a binary format and needs to be deserialized first.
Note: The returned Java object may be reused.
toObject
in interface RawValueData<T>
public byte[] toBytes(TypeSerializer<T> serializer)
RawValueData
RawValueData
into a byte array.
The given serializer is required because the "raw value" might be still be a Java object and needs to be serialized first.
Note: The returned byte array may be reused.
toBytes
in interface RawValueData<T>
protected BinarySection materialize(TypeSerializer<T> serializer)
LazyBinaryFormat
RawValueData
needs javaObjectSerializer).materialize
in class LazyBinaryFormat<T>
public static <T> BinaryRawValueData<T> fromObject(T javaObject)
BinaryRawValueData
instance from the given Java object.fromObject
in interface RawValueData<T>
public static <T> BinaryRawValueData<T> fromBytes(byte[] bytes)
BinaryStringData
instance from the given bytes.fromBytes
in interface RawValueData<T>
public static <T> BinaryRawValueData<T> fromBytes(byte[] bytes, int offset, int numBytes)
BinaryStringData
instance from the given bytes with offset and number of
bytes.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.