public abstract class AbstractVarIntSupport
extends java.lang.Object
| Constructor and Description |
|---|
AbstractVarIntSupport() |
| Modifier and Type | Method and Description |
|---|---|
static int |
computeVarIntSize(int value)
Compute the number of bytes that would be needed to encode a varint.
|
static int |
computeVarLongSize(long value)
Compute the number of bytes that would be needed to encode a varint.
|
static int |
computeVarSignedIntSize(int value)
Compute the number of bytes that would be needed to encode a signed varint.
|
static int |
computeVarSignedLongSize(long value)
Compute the number of bytes that would be needed to encode a signed varint.
|
protected abstract byte |
readByte() |
int |
readVarInt()
Read a raw Varint from the stream.
|
long |
readVarLong()
Read a raw Varint from the stream.
|
int |
readVarSignedInt()
Read an
sint32 field value from the stream. |
long |
readVarSignedLong()
Read an
sint64 field value from the stream. |
protected abstract void |
writeByte(int value) |
void |
writeVarInt(int value)
Encode and write a varint.
|
void |
writeVarLong(long value)
Encode and write a varint.
|
void |
writeVarSignedInt(int value) |
void |
writeVarSignedLong(long value) |
protected abstract byte readByte()
throws java.io.IOException
java.io.IOExceptionprotected abstract void writeByte(int value)
throws java.io.IOException
java.io.IOExceptionpublic int readVarInt()
throws java.io.IOException
java.io.IOExceptionpublic long readVarLong()
throws java.io.IOException
java.io.IOExceptionpublic int readVarSignedInt()
throws java.io.IOException
sint32 field value from the stream.java.io.IOExceptionpublic long readVarSignedLong()
throws java.io.IOException
sint64 field value from the stream.java.io.IOExceptionpublic void writeVarInt(int value)
throws java.io.IOException
value is treated as unsigned, so it
won't be sign-extended if negative.java.io.IOExceptionpublic void writeVarLong(long value)
throws java.io.IOException
java.io.IOExceptionpublic void writeVarSignedInt(int value)
throws java.io.IOException
java.io.IOExceptionpublic void writeVarSignedLong(long value)
throws java.io.IOException
java.io.IOExceptionpublic static int computeVarIntSize(int value)
value is treated as unsigned, so it won't be sign-extended if
negative.public static int computeVarLongSize(long value)
public static int computeVarSignedIntSize(int value)
public static int computeVarSignedLongSize(long value)
Copyright © 2010-2014 FuseSource, Corp.. All Rights Reserved.