22.1
java.io.DataInput
THE PACKAGE JAVA.IO
22.1.7
public short readShort() throws IOException
The general contract of
readShort
is that it reads two input bytes and returns a
short
value. Let
a
be the first byte read and
b
be the second byte. The value
returned is:
(short)((a << 8) | (b & 0xff))
This method is suitable for reading the bytes written by the
writeShort
method of interface
DataOutput
( 22.2.6).
22.1.8
public int readUnsignedShort() throws IOException
The general contract of
readUnsignedShort
is that it reads two input bytes and
returns an
int
value in the range
0
through
65535
. Let
a
be the first byte read and
b
be the second byte. The value returned is:
(((a & 0xff) << 8) | (b & 0xff))
This method is suitable for reading the bytes written by the
writeShort
method of interface
DataOutput
( 22.2.6) if the argument to
writeShort
was
intended to be a value in the range
0
through
65535
.
22.1.9
public char readChar() throws IOException
The general contract of
readChar
is that it reads two input bytes and returns a
char
value. Let
a
be the first byte read and
b
be the second byte. The value
returned is:
(char)((a << 8) | (b & 0xff))
This method is suitable for reading bytes written by the
writeChar
method of
interface
DataOutput
( 22.2.7).
22.1.10
public int readInt() throws IOException
The general contract of
readInt
is that it reads four input bytes and returns an
int
value. Let
a
be the first byte read,
b
be the second byte,
c
be the third byte,
and
d
be the fourth byte. The value returned is:
(((a & 0xff) << 24) | ((b & 0xff) << 16) |
((c & 0xff) <<
8) | (d & 0xff))
This method is suitable for reading bytes written by the
writeInt
method of
interface
DataOutput
( 22.2.8).
670
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved