public short expectShort ( ) throws IOException { int b1 = in . read ( ) ; if ( b1 < 0 ) { throw new IOException ( "Missing byte 1 to expected short" ) ; } int b2 = in . read ( ) ; if ( b2 < 0 ) { throw new IOException ( "Missing byte 2 to expected short" ) ; } return ( short ) unshift2bytes ( b1 , b2 ) ; }
Read a short from the input stream .