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

com.zeroc.IcePatch2.ByteSeqSeqHelper Maven / Gradle / Ivy

There is a newer version: 3.7.10
Show newest version
// **********************************************************************
//
// Copyright (c) 2003-2018 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.7.1
//
// 
//
// Generated from file `FileServer.ice'
//
// Warning: do not edit this file.
//
// 
//

package com.zeroc.IcePatch2;

public final class ByteSeqSeqHelper
{
    public static void write(com.zeroc.Ice.OutputStream ostr, byte[][] v)
    {
        if(v == null)
        {
            ostr.writeSize(0);
        }
        else
        {
            ostr.writeSize(v.length);
            for(int i0 = 0; i0 < v.length; i0++)
            {
                ostr.writeByteSeq(v[i0]);
            }
        }
    }

    public static byte[][] read(com.zeroc.Ice.InputStream istr)
    {
        final byte[][] v;
        final int len0 = istr.readAndCheckSeqSize(1);
        v = new byte[len0][];
        for(int i0 = 0; i0 < len0; i0++)
        {
            v[i0] = istr.readByteSeq();
        }
        return v;
    }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy