public abstract class AbstractMarshaller extends Object implements Marshaller
GridByteArrayList
. These implementations
use GridByteArrayInputStream
or GridByteArrayOutputStream
to marshal and unmarshal objects.Modifier and Type | Field and Description |
---|---|
protected MarshallerContext |
ctx
Context.
|
static int |
DFLT_BUFFER_SIZE
Default initial buffer size for the
GridByteArrayOutputStream . |
Constructor and Description |
---|
AbstractMarshaller() |
Modifier and Type | Method and Description |
---|---|
byte[] |
marshal(Object obj)
Marshals object to byte array.
|
void |
setContext(MarshallerContext ctx)
Sets marshaller context.
|
<T> T |
unmarshal(byte[] arr,
ClassLoader clsLdr)
Unmarshals object from byte array using given class loader.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
marshal, unmarshal
public static final int DFLT_BUFFER_SIZE
GridByteArrayOutputStream
.protected MarshallerContext ctx
public void setContext(MarshallerContext ctx)
setContext
in interface Marshaller
ctx
- Marshaller context.public byte[] marshal(@Nullable Object obj) throws IgniteCheckedException
marshal
in interface Marshaller
obj
- Object to marshal.IgniteCheckedException
- If marshalling failed.public <T> T unmarshal(byte[] arr, @Nullable ClassLoader clsLdr) throws IgniteCheckedException
unmarshal
in interface Marshaller
T
- Type of unmarshalled object.arr
- Byte array.clsLdr
- Class loader to use.IgniteCheckedException
- If unmarshalling failed.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.2.0-incubating Release Date : June 16 2015