Java Reference
In-Depth Information
public abstract void
readFully(byte[] buf)
tHRows IOException
Equivalent to
readFully(buf,0, buf.length)
.
public abstract int
skipBytes(int count)
throws IOException
Attempts to skip over
count
bytes, discarding any bytes
skipped over. Returns the actual number of bytes skipped.
This method never throws an
EOFException
.
public abstract int
readUnsignedByte()
throws IOException
Reads one input byte, zero-extends it to type
int
, and returns
the result, which is therefore in the range 0 through 255. This
method is suitable for reading a byte written by the
writeByte
method of
DataOutput
if the argument to
writeByte
was a value
in the range 0 through 255.
public abstract int
readUnsignedShort()
throws IOException
Reads two input bytes and returns an
int
value in the range 0
through 65535. The first byte read is made the high byte. This
method is suitable for reading bytes written by the
writeShort
method of
DataOutput
if the argument to
writeShort
was a value
in the range 0 through 65535.
The
DataInput
interface methods usually handle end-of-file (stream) by
throwing
EOFException
when it occurs.
EOFException
extends
IOException
.
The
DataOutput
interface supports signatures equivalent to the three
forms of
write
in
OutputStream
and with the same specified behavior. Ad-
ditionally, it provides the following unmirrored methods:
public abstract void
writeBytes(String s)
throws IOException
Writes a
String
as a sequence of bytes. The upper byte in each
character is lost, so unless you are willing to lose data, use