class ClientBinaryMarshaller {
    /** Metadata handler. */
    private final BinaryMetadataHandler metaHnd;

    /** Marshaller context. */
    private final MarshallerContext marshCtx;

    /** Re-using marshaller implementation from Ignite core. */
    private GridBinaryMarshaller impl;

    /**
     * Constructor.
     */
    ClientBinaryMarshaller(BinaryMetadataHandler metaHnd, MarshallerContext marshCtx) {
        this.metaHnd = metaHnd;
        this.marshCtx = marshCtx;

        impl = createImpl(null);
    }

    /**
     * Unmarshals Ignite binary object from input stream.
     *
     * @param in Input stream.
     * @return Binary object.
     */
    public <T> T unmarshal(BinaryInputStream in) {
        return impl.unmarshal(in);
    }

    /**
     * Deserializes object from input stream.
     *
     * @param in Input stream.
     * @param hnds Object handles.
     */
    public <T> T deserialize(BinaryInputStream in, BinaryReaderHandles hnds) {
        return impl.deserialize(in, null, hnds);
    }

    /**
     * Serializes Java object into a byte array.
     */
    public byte[] marshal(Object obj) {
        return impl.marshal(obj, false);
    }

    /**
     * Configure marshaller with custom Ignite Binary Object configuration.
     */
    public void setBinaryConfiguration(BinaryConfiguration binCfg) {
        impl = createImpl(binCfg);
    }

    /**
     * @return The marshaller context.
     */
    public BinaryContext context() {
        return impl.context();
    }

    /** Create new marshaller implementation. */
    private GridBinaryMarshaller createImpl(BinaryConfiguration binCfg) {<FILL_FUNCTION_BODY>}
}

        IgniteConfiguration igniteCfg = new IgniteConfiguration();

        if (binCfg == null) {
            binCfg = new BinaryConfiguration();

            binCfg.setCompactFooter(false);
        }

        igniteCfg.setBinaryConfiguration(binCfg);

        BinaryContext ctx = new BinaryContext(metaHnd, igniteCfg, NullLogger.INSTANCE);

        BinaryMarshaller marsh = new BinaryMarshaller();

        marsh.setContext(marshCtx);

        ctx.configure(marsh, binCfg);

        ctx.registerUserTypesSchema();

        return new GridBinaryMarshaller(ctx);
    
<no_super_class>