All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.zeroc.Ice.ObjectProxySeqHelper Maven / Gradle / Ivy

Go to download

Ice is a comprehensive RPC framework that helps you build distributed applications with minimal effort using familiar object-oriented idioms

There is a newer version: 3.7.10
Show newest version
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
//
// Ice version 3.7.3
//
// 
//
// Generated from file `BuiltinSequences.ice'
//
// Warning: do not edit this file.
//
// 
//

package com.zeroc.Ice;

/**
 * Helper class for marshaling/unmarshaling ObjectProxySeq.
 **/
public final class ObjectProxySeqHelper
{
    public static void write(OutputStream ostr, ObjectPrx[] v)
    {
        if(v == null)
        {
            ostr.writeSize(0);
        }
        else
        {
            ostr.writeSize(v.length);
            for(int i0 = 0; i0 < v.length; i0++)
            {
                ostr.writeProxy(v[i0]);
            }
        }
    }

    public static ObjectPrx[] read(InputStream istr)
    {
        final ObjectPrx[] v;
        final int len0 = istr.readAndCheckSeqSize(2);
        v = new ObjectPrx[len0];
        for(int i0 = 0; i0 < len0; i0++)
        {
            v[i0] = istr.readProxy();
        }
        return v;
    }

    public static void write(OutputStream ostr, int tag, java.util.Optional v)
    {
        if(v != null && v.isPresent())
        {
            write(ostr, tag, v.get());
        }
    }

    public static void write(OutputStream ostr, int tag, ObjectPrx[] v)
    {
        if(ostr.writeOptional(tag, com.zeroc.Ice.OptionalFormat.FSize))
        {
            int pos = ostr.startSize();
            ObjectProxySeqHelper.write(ostr, v);
            ostr.endSize(pos);
        }
    }

    public static java.util.Optional read(InputStream istr, int tag)
    {
        if(istr.readOptional(tag, com.zeroc.Ice.OptionalFormat.FSize))
        {
            istr.skip(4);
            ObjectPrx[] v;
            v = ObjectProxySeqHelper.read(istr);
            return java.util.Optional.of(v);
        }
        else
        {
            return java.util.Optional.empty();
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy