Fix bytesToInt parse error (#13808)

Co-authored-by: 陈浩宇 <jingfeng.xjf@alibaba-inc.com>
This commit is contained in:
Achilles 2024-03-01 14:23:54 +08:00 committed by GitHub
parent 1dd289d405
commit 22b3c29b08
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -182,7 +182,7 @@ public class LengthFieldStreamingDecoder implements StreamingDecoder {
}
protected static int bytesToInt(byte[] bytes) {
return (bytes[0] << 24) & 0xFF | (bytes[1] << 16) & 0xFF | (bytes[2] << 8) & 0xFF | (bytes[3]) & 0xFF;
return ((bytes[0] & 0xFF) << 24) | ((bytes[1] & 0xFF) << 16) | ((bytes[2] & 0xFF) << 8) | (bytes[3]) & 0xFF;
}
private enum DecodeState {