java.io.DataInput |
Known Indirect Subclasses |
Defines an interface for classes that are able to read typed data from some
source. Typically, this data has been written by a class which implements
DataOutput
. Types that can be read include byte, 16-bit short, 32-bit
int, 32-bit float, 64-bit long, 64-bit double, byte strings, and MUTF-8
strings.
When encoding strings as UTF, implementations of DataInput
and
DataOutput
use a slightly modified form of UTF-8, hereafter referred
to as MUTF-8. This form is identical to standard UTF-8, except:
U+10000
…
U+10ffff
are encoded as a surrogate pair, each of which is
represented as a three-byte encoded value.U+0000
is encoded in two-byte form.Please refer to The Unicode Standard for further information about character encoding. MUTF-8 is actually closer to the (relatively less well-known) encoding CESU-8 than to UTF-8 per se.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Reads a boolean.
| |||||||||||
Reads an 8-bit byte value.
| |||||||||||
Reads a 16-bit character value.
| |||||||||||
Reads a 64-bit double value.
| |||||||||||
Reads a 32-bit float value.
| |||||||||||
Reads bytes and stores them in the byte array
buffer starting at
offset offset . | |||||||||||
Reads bytes into the byte array
buffer . | |||||||||||
Reads a 32-bit integer value.
| |||||||||||
Returns a string containing the next line of text available from this
stream.
| |||||||||||
Reads a 64-bit long value.
| |||||||||||
Reads a 16-bit short value.
| |||||||||||
Reads a string encoded with
modified UTF-8 . | |||||||||||
Reads an unsigned 8-bit byte value and returns it as an int.
| |||||||||||
Reads a 16-bit unsigned short value and returns it as an int.
| |||||||||||
Skips
count number of bytes. |
Reads a boolean.
EOFException | if the end of the input is reached before the read request can be satisfied. |
---|---|
IOException | if an I/O error occurs while reading. |
Reads an 8-bit byte value.
EOFException | if the end of the input is reached before the read request can be satisfied. |
---|---|
IOException | if an I/O error occurs while reading. |
Reads a 16-bit character value.
EOFException | if the end of the input is reached before the read request can be satisfied. |
---|---|
IOException | if an I/O error occurs while reading. |
Reads a 64-bit double value.
EOFException | if the end of the input is reached before the read request can be satisfied. |
---|---|
IOException | if an I/O error occurs while reading. |
Reads a 32-bit float value.
EOFException | if the end of the input is reached before the read request can be satisfied. |
---|---|
IOException | if an I/O error occurs while reading. |
Reads bytes and stores them in the byte array buffer
starting at
offset offset
. This method blocks until count
number of
bytes have been read.
buffer | the byte array in which to store the bytes read. |
---|---|
offset | the initial position in buffer to store the bytes
read. |
count | the maximum number of bytes to store in buffer . |
EOFException | if the end of the input is reached before the read request can be satisfied. |
---|---|
IOException | if an I/O error occurs while reading. |
Reads bytes into the byte array buffer
. This method will block
until buffer.length
number of bytes have been read.
buffer | the buffer to read bytes into. |
---|
EOFException | if the end of the input is reached before the read request can be satisfied. |
---|---|
IOException | if an I/O error occurs while reading. |
Reads a 32-bit integer value.
EOFException | if the end of the input is reached before the read request can be satisfied. |
---|---|
IOException | if an I/O error occurs while reading. |
Returns a string containing the next line of text available from this
stream. A line is made of zero or more characters followed by '\n'
, '\r'
, "\r\n"
or the end of the stream. The string
does not include the newline sequence.
EOFException | if the end of the input is reached before the read request can be satisfied. |
---|---|
IOException | if an I/O error occurs while reading. |
Reads a 64-bit long value.
EOFException | if the end of the input is reached before the read request can be satisfied. |
---|---|
IOException | if an I/O error occurs while reading. |
Reads a 16-bit short value.
EOFException | if the end of the input is reached before the read request can be satisfied. |
---|---|
IOException | if an I/O error occurs while reading. |
Reads a string encoded with modified UTF-8
.
modified UTF-8
.EOFException | if the end of the input is reached before the read request can be satisfied. |
---|---|
IOException | if an I/O error occurs while reading. |
Reads an unsigned 8-bit byte value and returns it as an int.
EOFException | if the end of the input is reached before the read request can be satisfied. |
---|---|
IOException | if an I/O error occurs while reading. |
Reads a 16-bit unsigned short value and returns it as an int.
EOFException | if the end of the input is reached before the read request can be satisfied. |
---|---|
IOException | if an I/O error occurs while reading. |
Skips count
number of bytes. This method will not throw an
EOFException
if the end of the input is reached before
count
bytes where skipped.
count | the number of bytes to skip. |
---|
IOException | if a problem occurs during skipping. |
---|