org.apache.ignite.internal.igfs.common

## Class IgfsMarshaller

- java.lang.Object
- - org.apache.ignite.internal.igfs.common.IgfsMarshaller

    public class IgfsMarshaller
    extends Object

Implementation of IGFS client message marshaller.

### Field Summary

Fields
`static int` `HEADER_SIZE` Packet header size.

### Constructor Summary

Constructors
Constructor and Description
`IgfsMarshaller()`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static byte[]` `createHeader(long reqId, IgfsIpcCommand cmd)` Creates new header with given request ID and command.
`static byte[]` `fillHeader(byte[] hdr, long reqId, IgfsIpcCommand cmd)` Creates new header with given request ID and command.
`void` `marshall(IgfsMessage msg, byte[] hdr, ObjectOutput out)` Serializes the message and sends it into the given output stream.
`IgfsMessage` `unmarshall(IgfsIpcCommand cmd, byte[] hdr, ObjectInput in)`

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

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

### Field Detail

#### HEADER_SIZE

    public static final int HEADER_SIZE

Packet header size.

See Also:
  Constant Field Values

### Constructor Detail

#### IgfsMarshaller

    public IgfsMarshaller()

### Method Detail

#### createHeader

    public static byte[] createHeader(long reqId,
                                      IgfsIpcCommand cmd)

Creates new header with given request ID and command.

Parameters:
  `reqId` - Request ID.
  `cmd` - Command.
Returns:
  Created header.

#### fillHeader

    public static byte[] fillHeader(byte[] hdr,
                                    long reqId,
                                    IgfsIpcCommand cmd)

Creates new header with given request ID and command.

Parameters:
  `reqId` - Request ID.
  `cmd` - Command.
Returns:
  Created header.

#### marshall

    public void marshall(IgfsMessage msg,
                         byte[] hdr,
                         ObjectOutput out)
                  throws IgniteCheckedException

Serializes the message and sends it into the given output stream.

Parameters:
  `msg` - Message.
  `hdr` - Message header.
  `out` - Output.
Throws:
  `IgniteCheckedException` - If failed.

#### unmarshall

    public IgfsMessage unmarshall(IgfsIpcCommand cmd,
                                  byte[] hdr,
                                  ObjectInput in)
                           throws IgniteCheckedException

Parameters:
  `cmd` - Command.
  `hdr` - Header.
  `in` - Input.
Returns:
  Message.
Throws:
  `IgniteCheckedException` - If failed.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.6
Release Date | : September 11 2019