标签: java
如何在Java中将2个字节值连接成一个短值?
此:
byte b1 = 0xAC; byte b2 = 0xAD; short pixelShort = (short) (b1<<8 | b2);
不起作用,因为结果是0xFFAD。这是为什么?