com.zeroc.IcePatch2.ByteSeqSeqHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of icepatch2 Show documentation
Show all versions of icepatch2 Show documentation
File distribution and patching for Ice
// **********************************************************************
//
// 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();
}
}
}