DataReader

This class is backed by an input stream and supports reading values and variable size data.

Methods
DataReader(InputStream in)
Create a new data reader.
DataReader(InputStream in)
Create a new data reader.
Parameters:
in - the input stream
void close()
void close() throws IOException
int read(char[] buff, int off, int len)
int read(char[] buff, int off, int len) throws IOException
byte readByte()
Read a byte.
byte readByte() throws IOException
Read a byte.
Returns:
the byte
void readFully(byte[] buff, int len)
Read a number of bytes.
void readFully(byte[] buff, int len) throws IOException
Read a number of bytes.
Parameters:
buff - the target buffer
len - the number of bytes to read
String readString()
Read a string from the stream.
String readString() throws IOException
Read a string from the stream.
Returns:
the string
int readVarInt()
Read a variable size integer.
int readVarInt() throws IOException
Read a variable size integer.
Returns:
the value
long readVarLong()
Read a variable size long.
long readVarLong() throws IOException
Read a variable size long.
Returns:
the value