private int readUShort ( int pos ) { int ret = output [ pos ] ; if ( ret < 0 ) { ret += 256 ; } ret = ret << 8 ; if ( output [ pos + 1 ] < 0 ) { ret |= output [ pos + 1 ] + 256 ; } else { ret |= output [ pos + 1 ] ; } return ret ; }
Read a unsigned short value at given position