public interface DataInput extends AutoCloseable
Modifier and Type | Method and Description |
---|---|
boolean |
readBoolean()
Reads one input byte and returns true if that byte is nonzero, false if that byte is zero.
|
byte |
readByte()
Reads and returns one input byte.
|
char |
readChar()
Reads an input char and returns the char value.
|
double |
readDouble()
Reads eight input bytes and returns a double value.
|
float |
readFloat()
Reads four input bytes and returns a float value.
|
void |
readFully(byte[] b)
Reads some bytes from an input stream and stores them into the buffer array b.
|
void |
readFully(byte[] b,
int off,
int len)
Reads len bytes from an input stream.
|
int |
readInt()
Reads four input bytes and returns an int value.
|
long |
readLong()
Reads eight input bytes and returns a long value.
|
short |
readShort()
Reads two input bytes and returns a short value.
|
int |
readUnsignedByte()
Reads one input byte, zero-extends it to type int, and returns the result, which is therefore in the range 0 through 255.
|
int |
readUnsignedShort()
Reads two input bytes, zero-extends it to type int, and returns an int value in the range 0 through 65535.
|
String |
readUTF()
Reads in a string that has been encoded using a modified UTF-8 format.
|
int |
skipBytes(int n)
Makes an attempt to skip over n bytes of data from the input stream, discarding the skipped bytes.
|
close
boolean readBoolean() throws IOException
IOException
byte readByte() throws IOException
IOException
char readChar() throws IOException
IOException
double readDouble() throws IOException
IOException
float readFloat() throws IOException
IOException
void readFully(byte[] b) throws IOException
IOException
void readFully(byte[] b, int off, int len) throws IOException
IOException
int readInt() throws IOException
IOException
long readLong() throws IOException
IOException
short readShort() throws IOException
IOException
int readUnsignedByte() throws IOException
IOException
int readUnsignedShort() throws IOException
IOException
String readUTF() throws IOException
IOException
int skipBytes(int n) throws IOException
IOException