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
IOException
public int readVarInt() throws IOException
IOException
public long readVarLong() throws IOException
IOException
public 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 readIOException
public String readString() throws IOException
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class Reader
IOException
public int read(char[] buff, int off, int len) throws IOException
read
in class Reader
IOException
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.