public final class VarInt extends Object
Some code from http://wiki.vg/Protocol.
| Modifier and Type | Method and Description |
|---|---|
static int |
decodeZigZag32(long v) |
static long |
decodeZigZag64(long v) |
static long |
encodeZigZag32(int v) |
static long |
encodeZigZag64(long v) |
static long |
readUnsignedVarInt(io.netty.buffer.ByteBuf buffer) |
static long |
readUnsignedVarInt(InputStream buffer) |
static long |
readUnsignedVarLong(io.netty.buffer.ByteBuf buffer) |
static long |
readUnsignedVarLong(InputStream buffer) |
static int |
readVarInt(io.netty.buffer.ByteBuf buffer) |
static int |
readVarInt(InputStream buffer) |
static long |
readVarLong(io.netty.buffer.ByteBuf buffer) |
static long |
readVarLong(InputStream buffer) |
static void |
writeUnsignedVarInt(io.netty.buffer.ByteBuf buffer,
long value) |
static void |
writeUnsignedVarInt(OutputStream buffer,
long value) |
static void |
writeUnsignedVarLong(io.netty.buffer.ByteBuf buffer,
long value) |
static void |
writeUnsignedVarLong(OutputStream buffer,
long value) |
static void |
writeVarInt(io.netty.buffer.ByteBuf buffer,
int value) |
static void |
writeVarInt(OutputStream buffer,
int value) |
static void |
writeVarLong(io.netty.buffer.ByteBuf buffer,
long value) |
static void |
writeVarLong(OutputStream buffer,
long value) |
public static long encodeZigZag32(int v)
v - Signed intpublic static int decodeZigZag32(long v)
v - Unsigned encoded intpublic static long encodeZigZag64(long v)
v - Signed longpublic static long decodeZigZag64(long v)
v - Signed encoded longpublic static int readVarInt(io.netty.buffer.ByteBuf buffer)
buffer - BinaryStreampublic static int readVarInt(InputStream buffer) throws IOException
buffer - InputStreamIOExceptionpublic static long readUnsignedVarInt(io.netty.buffer.ByteBuf buffer)
buffer - BinaryStreampublic static long readUnsignedVarInt(InputStream buffer) throws IOException
buffer - InputStreamIOExceptionpublic static long readVarLong(io.netty.buffer.ByteBuf buffer)
buffer - BinaryStreampublic static long readVarLong(InputStream buffer) throws IOException
buffer - InputStreamIOExceptionpublic static long readUnsignedVarLong(io.netty.buffer.ByteBuf buffer)
buffer - BinaryStreampublic static long readUnsignedVarLong(InputStream buffer) throws IOException
buffer - InputStreamIOExceptionpublic static void writeVarInt(io.netty.buffer.ByteBuf buffer,
int value)
buffer - BinaryStreamvalue - Signed intpublic static void writeVarInt(OutputStream buffer, int value) throws IOException
buffer - OutputStreamvalue - Signed intIOExceptionpublic static void writeUnsignedVarInt(io.netty.buffer.ByteBuf buffer,
long value)
buffer - BinaryStreamvalue - Unsigned intpublic static void writeUnsignedVarInt(OutputStream buffer, long value) throws IOException
buffer - OutputStreamvalue - Unsigned intIOExceptionpublic static void writeVarLong(io.netty.buffer.ByteBuf buffer,
long value)
buffer - BinaryStreamvalue - Signed longpublic static void writeVarLong(OutputStream buffer, long value) throws IOException
buffer - OutputStreamvalue - Signed longIOExceptionpublic static void writeUnsignedVarLong(io.netty.buffer.ByteBuf buffer,
long value)
buffer - BinaryStreamvalue - Unsigned longpublic static void writeUnsignedVarLong(OutputStream buffer, long value) throws IOException
buffer - OutputStreamvalue - Unsigned longIOExceptionCopyright © 2020. All rights reserved.