Skip to content

Commit

Permalink
fix readInt bug
Browse files Browse the repository at this point in the history
  • Loading branch information
leonchen83 authored Sep 23, 2016
1 parent 2910969 commit 4b5dc91
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ public int readInt(byte[] bytes) {

public int readInt(byte[] bytes, boolean littleEndian) {
int r = 0;
for (int i = 0; i < bytes.length; ++i) {
int length = bytes.length;
for (int i = 0; i < length; ++i) {
final int v = bytes[i] & 0xff;
if (littleEndian) {
r |= (v << (i << 3));
Expand Down

0 comments on commit 4b5dc91

Please sign in to comment.