public class DataReader
extends java.io.Reader
| Constructor and Description |
|---|
DataReader(java.io.InputStream in)
Create a new data reader.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
int |
read(char[] buff,
int off,
int len) |
byte |
readByte()
Read a byte.
|
void |
readFully(byte[] buff,
int len)
Read a number of bytes.
|
java.lang.String |
readString()
Read a string from the stream.
|
int |
readVarInt()
Read a variable size integer.
|
long |
readVarLong()
Read a variable size long.
|
public DataReader(java.io.InputStream in)
in - the input streampublic byte readByte()
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 void readFully(byte[] buff,
int len)
throws java.io.IOException
buff - the target bufferlen - the number of bytes to readjava.io.IOExceptionpublic java.lang.String readString()
throws java.io.IOException
java.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.Readerjava.io.IOExceptionpublic int read(char[] buff,
int off,
int len)
throws java.io.IOException
read in class java.io.Readerjava.io.IOException