public interface InternalSerializationService extends SerializationService, Disposable
Modifier and Type | Field and Description |
---|---|
static byte |
VERSION_1 |
getManagedContext, toData, toData, toObject, toObject
dispose
static final byte VERSION_1
byte[] toBytes(Object obj)
SerializationService.toData(Object)
and
then calling Data.toByteArray()
. But it doesn't force a HeapData object being created.
IMPORTANT: The byte order used to serialize obj
's serializer type ID is always
ByteOrder.BIG_ENDIAN
.
byte[] toBytes(Object obj, int leftPadding, boolean insertPartitionHash)
If you want to convert an object to a Data (or its byte representation) then you want to have the partition hash, because that is part of the Data-definition. But if you want to serialize an object to a byte-array and don't care for the Data partition-hash, the hash can be disabled.
IMPORTANT: The byte order used to serialize obj
's serializer type ID is the byte order
configured in SerializationConfig.getByteOrder()
.
obj
- object to write to byte arrayleftPadding
- offset from beginning of byte array to start writing the object's bytesinsertPartitionHash
- true
to include the partition hash in the byte array, otherwise false
<B extends Data> B toData(Object obj, DataType type, PartitioningStrategy strategy)
void writeObject(ObjectDataOutput out, Object obj)
<T> T readObject(ObjectDataInput in)
<T> T readObject(ObjectDataInput in, Class aClass)
void disposeData(Data data)
BufferObjectDataInput createObjectDataInput(byte[] data)
BufferObjectDataInput createObjectDataInput(Data data)
BufferObjectDataOutput createObjectDataOutput(int size)
BufferObjectDataOutput createObjectDataOutput()
PortableReader createPortableReader(Data data) throws IOException
IOException
PortableContext getPortableContext()
ClassLoader getClassLoader()
ByteOrder getByteOrder()
serializerTypeId
: when using toBytes(Object)
, the object's serializerTypeId
is serialized
always in ByteOrder.BIG_ENDIAN
, while when using toBytes(Object, int, boolean)
, the configured
byte order is used. Inner objects (for example those serialized within an
IdentifiedDataSerializable
's writeData(ObjectDataOutput)
with
ObjectDataOutput.writeObject(Object)
) always use the configured byte order.ByteOrder
which is configured for this InternalSerializationService
.SerializationConfig.setByteOrder(ByteOrder)
,
SerializationConfig.setUseNativeByteOrder(boolean)
,
SerializationConfig.setAllowUnsafe(boolean)
byte getVersion()
Copyright © 2018 Hazelcast, Inc.. All Rights Reserved.