zserio.runtime.VarSizeUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of zserio-runtime Show documentation
Show all versions of zserio-runtime Show documentation
Java Runtime library for Zserio Serialization Framework
The newest version!
package zserio.runtime;
/**
* Provide converting functions from varsize values which check range correctness.
*/
public final class VarSizeUtil
{
/**
* Converts bit buffer size to signed integer value.
*
* @param value Bit buffer size to convert.
*
* @return Checked signed integer value.
*/
public static int convertBitBufferSizeToInt(long value)
{
if (value > Integer.MAX_VALUE)
throw new ZserioError("VarSizeUtil: Value '" + value + "' is out of bounds for conversion!");
return (int)value;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy