org.apache.ignite.internal.client.marshaller.optimized

## Class GridClientZipOptimizedMarshaller

- java.lang.Object
- - org.apache.ignite.internal.client.marshaller.optimized.GridClientOptimizedMarshaller
  - - org.apache.ignite.internal.client.marshaller.optimized.GridClientZipOptimizedMarshaller

All Implemented Interfaces:
  GridClientMarshaller

    public class GridClientZipOptimizedMarshaller
    extends GridClientOptimizedMarshaller

Wrapper, that adapts `OptimizedMarshaller` to `GridClientMarshaller` interface.

### Field Summary

Fields
`static byte` `ID` ID.

### Fields inherited from class org.apache.ignite.internal.client.marshaller.optimized.GridClientOptimizedMarshaller

`opMarsh`

### Constructor Summary

Constructors
Constructor and Description
`GridClientZipOptimizedMarshaller(GridClientMarshaller dfltMarsh, List<PluginProvider> plugins)` Constructor.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`GridClientMarshaller` `defaultMarshaller()` Default marshaller that will be used in case of backward compatibility.
`ByteBuffer` `marshal(Object obj, int off)` Marshals object to byte array.
`<T> T` `unmarshal(byte[] bytes)` Unmarshals object from byte array.
`static byte[]` `zipBytes(byte[] input)` Zips bytes.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### ID

    public static final byte ID

ID.

See Also:
  Constant Field Values

### Constructor Detail

#### GridClientZipOptimizedMarshaller

    public GridClientZipOptimizedMarshaller(GridClientMarshaller dfltMarsh,
                                            @Nullable
                                            List<PluginProvider> plugins)

Constructor.

Parameters:
  `dfltMarsh` - Marshaller to fallback to.
  `plugins` - Plugins.

### Method Detail

#### defaultMarshaller

    public GridClientMarshaller defaultMarshaller()

Default marshaller that will be used in case of backward compatibility.

Returns:
  Marshaller to fallback.

#### zipBytes

    public static byte[] zipBytes(byte[] input)
                           throws IOException

Zips bytes.

Parameters:
  `input` - Input bytes.
Returns:
  Zipped byte array.
Throws:
  `IOException` - If failed.

#### marshal

    public ByteBuffer marshal(Object obj,
                              int off)
                       throws IOException

Marshals object to byte array.

Specified by:
  `marshal` in interface `GridClientMarshaller`
Overrides:
  `marshal` in class `GridClientOptimizedMarshaller`
Parameters:
  `obj` - Object to marshal.
  `off` - Start offset.
Returns:
  Byte buffer.
Throws:
  `IOException` - If marshalling failed.

#### unmarshal

    public <T> T unmarshal(byte[] bytes)
                    throws IOException

Unmarshals object from byte array.

Specified by:
  `unmarshal` in interface `GridClientMarshaller`
Overrides:
  `unmarshal` in class `GridClientOptimizedMarshaller`
Parameters:
  `bytes` - Byte array.
Returns:
  Unmarshalled object.
Throws:
  `IOException` - If unmarshalling failed.

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.5.0
Release Date | : May 23 2018