Package io.datarouter.bytes
Class VarIntTool
java.lang.Object
io.datarouter.bytes.VarIntTool
public class VarIntTool extends Object
-
Constructor Summary
Constructors Constructor Description VarIntTool() -
Method Summary
Modifier and Type Method Description static intdecodeInt(byte[] bytes)static intdecodeInt(byte[] bytes, int offset)static longdecodeLong(byte[] bytes)static longdecodeLong(byte[] bytes, int offset)static byte[]encode(long value)static Optional<Long>fromInputStream(InputStream is)static intlength(long value)
-
Constructor Details
-
VarIntTool
public VarIntTool()
-
-
Method Details
-
length
public static int length(long value) -
encode
public static byte[] encode(long value) -
decodeLong
public static long decodeLong(byte[] bytes, int offset) -
decodeLong
public static long decodeLong(byte[] bytes) -
decodeInt
public static int decodeInt(byte[] bytes, int offset) -
decodeInt
public static int decodeInt(byte[] bytes) -
fromInputStream
-