java icon indicating copy to clipboard operation
java copied to clipboard

报个bug

Open strongczq opened this issue 8 years ago • 1 comments

https://github.com/17mon/java/blob/3dc7a5e91f1f0f3e408a73a781fe74f467fe8964/IPExt.java#L67

以下代码前面一半少了一个括号: (0xFF & indexBuffer.get(start + 7) << 8) + (0xFF & indexBuffer.get(start + 8)); <<的优先级高于&,导致前面这部分算出来总是0,正确的应该是: ((0xFF & indexBuffer.get(start + 7)) << 8) + (0xFF & indexBuffer.get(start + 8));

strongczq avatar Nov 27 '17 12:11 strongczq

感谢,还好目前数据长度没有超过0xFF。

17mon avatar Nov 28 '17 08:11 17mon