public int readUI16() throws IOException {
  synchBits();
  int ui16=in.read();
  if (ui16 < 0) {
    throw new IOException("Unexpected end of input");
  }
  int val=in.read();
  if (val < 0) {
    throw new IOException("Unexpected end of input");
  }
  ui16+=val << 8;
  bytesRead+=2;
  return ui16;
}

public int readUI16 ( ) throws IOException { synchBits ( ) ; int ui16 = in . read ( ) ; if ( ui16 < 0 ) { throw new IOException ( "Unexpected end of input" ) ; } int val = in . read ( ) ; if ( val < 0 ) { throw new IOException ( "Unexpected end of input" ) ; } ui16 += val << 8 ; bytesRead += 2 ; return ui16 ; }
read an unsigned 16 bit value
