static void validateDecodingTable ( final short [ ] decodingTable , final short [ ] encodingTable ) { for ( int decodeThis = 0 ; decodeThis < 4096 ; decodeThis ++ ) { final int tmpD = decodingTable [ decodeThis ] & 0xFFFF ; final int decodedByte = tmpD & 0xff ; final int decodedLength = tmpD >> 8 ; final int tmpE = encodingTable [ decodedByte ] & 0xFFFF ; final int encodedBitpattern = tmpE & 0xfff ; final int encodedLength = tmpE >> 12 ; // encodedBitpattern++; // uncomment this line to force failure when testing this method // encodedLength++; // uncomment this line to force failure when testing this method assert ( decodedLength == encodedLength ) : "deLen: " + decodedLength + ", enLen: " + encodedLength ; assert ( encodedBitpattern == ( decodeThis & ( ( 1 << decodedLength ) - 1 ) ) ) ; } }
These short arrays are being treated as unsigned