DataInput.readShort

Reads two input bytes and returns a {@code short} value. Let {@code a} be the first byte read and {@code b} be the second byte. The value returned is: <pre>{@code (short)((a << 8) | (b & 0xff)) }</pre> This method is suitable for reading the bytes written by the {@code writeShort} method of interface {@code DataOutput}.

@return the 16-bit value read. @exception EOFException if this stream reaches the end before reading all the bytes. @exception IOException if an I/O error occurs.

interface DataInput
short
readShort
()

Meta