Class GridClientOptimizedMarshaller
- java.lang.Object
-
- org.apache.ignite.internal.client.marshaller.optimized.GridClientOptimizedMarshaller
-
- All Implemented Interfaces:
GridClientMarshaller
- Direct Known Subclasses:
GridClientZipOptimizedMarshaller
public class GridClientOptimizedMarshaller extends Object implements GridClientMarshaller
Wrapper, that adaptsOptimizedMarshallertoGridClientMarshallerinterface.
-
-
Field Summary
Fields Modifier and Type Field Description static byteIDID.protected OptimizedMarshalleropMarshOptimized marshaller.
-
Constructor Summary
Constructors Constructor Description GridClientOptimizedMarshaller()Default constructor.GridClientOptimizedMarshaller(boolean requireSer, int poolSize)Constructs optimized marshaller with specific parameters.GridClientOptimizedMarshaller(@Nullable List<PluginProvider> plugins)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteBuffermarshal(Object obj, int off)Marshals object to byte array.<T> Tunmarshal(byte[] bytes)Unmarshals object from byte array.
-
-
-
Field Detail
-
ID
public static final byte ID
ID.- See Also:
- Constant Field Values
-
opMarsh
protected final OptimizedMarshaller opMarsh
Optimized marshaller.
-
-
Constructor Detail
-
GridClientOptimizedMarshaller
public GridClientOptimizedMarshaller()
Default constructor.
-
GridClientOptimizedMarshaller
public GridClientOptimizedMarshaller(@Nullable @Nullable List<PluginProvider> plugins)Constructor.- Parameters:
plugins- Plugins.
-
GridClientOptimizedMarshaller
public GridClientOptimizedMarshaller(boolean requireSer, int poolSize) throws IOExceptionConstructs optimized marshaller with specific parameters.- Parameters:
requireSer- Require serializable flag.poolSize- Object streams pool size.- Throws:
IOException- If an I/O error occurs while writing stream header.IgniteException- If this marshaller is not supported on the current JVM.- See Also:
OptimizedMarshaller
-
-
Method Detail
-
marshal
public ByteBuffer marshal(Object obj, int off) throws IOException
Marshals object to byte array.- Specified by:
marshalin interfaceGridClientMarshaller- Parameters:
obj- Object to marshal.off- Start offset.- Returns:
- Byte buffer.
- Throws:
IOException- If marshalling failed.
-
unmarshal
public <T> T unmarshal(byte[] bytes) throws IOExceptionUnmarshals object from byte array.- Specified by:
unmarshalin interfaceGridClientMarshaller- Parameters:
bytes- Byte array.- Returns:
- Unmarshalled object.
- Throws:
IOException- If unmarshalling failed.
-
-