Skip to content

Commit

Permalink
Fixed EOS being returned when 0 bytes should be read.
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanSweet committed Jan 27, 2014
1 parent 201e051 commit bd01d4b
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public int read () throws IOException {
}

public int read (byte[] bytes, int offset, int length) throws IOException {
if (length == 0) return 0;
int count = Math.min(byteBuffer.remaining(), length);
if (count == 0) return -1;
byteBuffer.get(bytes, offset, count);
Expand Down

0 comments on commit bd01d4b

Please sign in to comment.