class PlatformStreamReceiverImpl extends PlatformAbstractPredicate implements PlatformStreamReceiver {
    /** */
    private static final long serialVersionUID = 0L;

    /** */
    private boolean keepBinary;

    /**
     * Constructor.
     */
    public PlatformStreamReceiverImpl() {
        super();
    }

    /**
     * Constructor.
     *
     * @param pred .Net binary receiver.
     * @param ptr Pointer to receiver in the native platform.
     * @param ctx Kernal context.
     */
    public PlatformStreamReceiverImpl(Object pred, long ptr, boolean keepBinary, PlatformContext ctx) {
        super(pred, ptr, ctx);

        assert pred != null;

        this.keepBinary = keepBinary;
    }

    /** {@inheritDoc} */
    @Override public void receive(IgniteCache<Object, Object> cache, Collection<Map.Entry<Object, Object>> collection)
        throws IgniteException {<FILL_FUNCTION_BODY>}

    /**
     * @param ignite Ignite instance.
     */
    @IgniteInstanceResource
    public void setIgniteInstance(Ignite ignite) {
        ctx = PlatformUtils.platformContext(ignite);
    }

    /** {@inheritDoc} */
    @Override public void writeExternal(ObjectOutput out) throws IOException {
        super.writeExternal(out);

        out.writeBoolean(keepBinary);
    }

    /** {@inheritDoc} */
    @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
        super.readExternal(in);

        keepBinary = in.readBoolean();
    }
}

        assert ctx != null;

        try (PlatformMemory mem = ctx.memory().allocate()) {
            PlatformOutputStream out = mem.output();

            out.writeLong(ptr);
            out.writeBoolean(keepBinary);

            BinaryRawWriterEx writer = ctx.writer(out);

            writer.writeObject(pred);

            writer.writeInt(collection.size());

            for (Map.Entry<Object, Object> e : collection) {
                writer.writeObject(e.getKey());
                writer.writeObject(e.getValue());
            }

            out.synchronize();

            PlatformCache cache0 = new PlatformCache(ctx, cache, keepBinary);
            PlatformTargetProxy cacheProxy = new PlatformTargetProxyImpl(cache0, ctx);

            ctx.gateway().dataStreamerStreamReceiverInvoke(ptr, cacheProxy, mem.pointer(), keepBinary);
        }
    
<methods>public void <init>() ,public void readExternal(java.io.ObjectInput) throws java.io.IOException, java.lang.ClassNotFoundException,public void writeExternal(java.io.ObjectOutput) throws java.io.IOException<variables>protected transient org.apache.ignite.internal.processors.platform.PlatformContext ctx,protected java.lang.Object pred,protected transient long ptr