public class DataReader extends Reader
| Constructor and Description |
|---|
DataReader(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 offset,
int len)
Read a number of bytes.
|
String |
readString()
Read a string from the stream.
|
int |
readVarInt()
Read a variable size integer.
|
long |
readVarLong()
Read a variable size long.
|
public DataReader(InputStream in)
in - the input streampublic byte readByte()
throws IOException
IOExceptionpublic int readVarInt()
throws IOException
IOExceptionpublic long readVarLong()
throws IOException
IOExceptionpublic void readFully(byte[] buff,
int offset,
int len)
throws IOException
buff - the target bufferoffset - the offset within the target bufferlen - the number of bytes to readIOExceptionpublic String readString() throws IOException
IOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class ReaderIOExceptionpublic int read(char[] buff,
int off,
int len)
throws IOException
read in class ReaderIOExceptionCopyright © 2012 JBoss by Red Hat. All Rights Reserved.