public class BinaryMarshaller extends AbstractNodeNameAwareMarshaller
Marshaller that lets to serialize and deserialize all objects
in the binary format.ctx, DFLT_BUFFER_SIZE| Constructor and Description |
|---|
BinaryMarshaller() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
available()
Checks whether
BinaryMarshaller is able to work on the current JVM. |
GridBinaryMarshaller |
binaryMarshaller() |
protected byte[] |
marshal0(@Nullable Object obj)
Marshals object to byte array.
|
protected void |
marshal0(@Nullable Object obj,
OutputStream out)
Marshals object to the output stream.
|
void |
onUndeploy(ClassLoader ldr)
Undeployment callback invoked when class loader is being undeployed.
|
String |
toString() |
protected <T> T |
unmarshal0(byte[] bytes,
@Nullable ClassLoader clsLdr)
Unmarshals object from byte array using given class loader.
|
protected <T> T |
unmarshal0(InputStream in,
@Nullable ClassLoader clsLdr)
Unmarshals object from the input stream using given class loader.
|
marshal, marshal, nodeName, unmarshal, unmarshalgetContext, setContextpublic static boolean available()
BinaryMarshaller is able to work on the current JVM.
As long as BinaryMarshaller uses JVM-private API, which is not guaranteed
to be available on all JVM, this method should be called to ensure marshaller could work properly.
Result of this method is automatically checked in constructor.
true if BinaryMarshaller can work on the current JVM or
false if it can't.protected byte[] marshal0(@Nullable
@Nullable Object obj)
throws IgniteCheckedException
marshal0 in class AbstractNodeNameAwareMarshallerobj - Object to marshal. null object will be marshaled to binary null representation.IgniteCheckedException - If marshalling failed.protected void marshal0(@Nullable
@Nullable Object obj,
OutputStream out)
throws IgniteCheckedException
marshal0 in class AbstractNodeNameAwareMarshallerobj - Object to marshal. null object will be marshaled to binary null representation.out - Output stream to marshal into.IgniteCheckedException - If marshalling failed.protected <T> T unmarshal0(byte[] bytes,
@Nullable
@Nullable ClassLoader clsLdr)
throws IgniteCheckedException
unmarshal0 in class AbstractNodeNameAwareMarshallerT - Type of unmarshalled object.bytes - Byte array.clsLdr - If not null then given class loader will be used for unmarshal object.IgniteCheckedException - If unmarshalling failed.protected <T> T unmarshal0(InputStream in, @Nullable @Nullable ClassLoader clsLdr) throws IgniteCheckedException
unmarshal0 in class AbstractNodeNameAwareMarshallerT - Type of unmarshalled object.in - Input stream.clsLdr - If not null then given class loader will be used for unmarshal object.IgniteCheckedException - If unmarshalling failed.public void onUndeploy(ClassLoader ldr)
onUndeploy in class AbstractMarshallerldr - Class loader being undeployed.public GridBinaryMarshaller binaryMarshaller()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.11.1 Release Date : December 20 2021