Skip to content

Commit

Permalink
Merge pull request #11 from bogdad/master
Browse files Browse the repository at this point in the history
Changed bytesLeft to long, per #10
  • Loading branch information
eaftan authored Oct 10, 2018
2 parents cd2019e + 4b860f8 commit 3668fd7
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ private boolean parseRecord(DataInput in, int idSize, boolean isFirstPass) throw

// otherwise propagate the EOFException
int time = in.readInt(); // TODO(eaftan): we might want time passed to handler fns
int bytesLeft = in.readInt();
long bytesLeft = Integer.toUnsignedLong(in.readInt());

long l1, l2, l3, l4;
int i1, i2, i3, i4, i5, i6, i7, i8, i9;
Expand All @@ -157,7 +157,7 @@ private boolean parseRecord(DataInput in, int idSize, boolean isFirstPass) throw
// String in UTF-8
l1 = readId(idSize, in);
bytesLeft -= idSize;
bArr1 = new byte[bytesLeft];
bArr1 = new byte[(int) bytesLeft];
in.readFully(bArr1);
if (isFirstPass) {
handler.stringInUTF8(l1, new String(bArr1));
Expand Down Expand Up @@ -202,7 +202,7 @@ private boolean parseRecord(DataInput in, int idSize, boolean isFirstPass) throw
i2 = in.readInt();
i3 = in.readInt();
bytesLeft -= 12;
lArr1 = new long[bytesLeft/idSize];
lArr1 = new long[(int) bytesLeft/idSize];
for (int i=0; i<lArr1.length; i++) {
lArr1[i] = readId(idSize, in);
}
Expand Down

0 comments on commit 3668fd7

Please sign in to comment.