Added missing exit condition
This commit is contained in:
parent
887e0b6de7
commit
575973863f
@ -85,8 +85,8 @@ public class ChunkedStream implements ChunkedInput {
|
||||
return null;
|
||||
}
|
||||
|
||||
int chunkSize = Math.min(this.chunkSize, in.available());
|
||||
byte[] chunk = new byte[chunkSize];
|
||||
final int chunkSize = Math.min(this.chunkSize, in.available());
|
||||
final byte[] chunk = new byte[chunkSize];
|
||||
int readBytes = 0;
|
||||
for (;;) {
|
||||
int localReadBytes = in.read(chunk, readBytes, chunkSize - readBytes);
|
||||
@ -95,6 +95,10 @@ public class ChunkedStream implements ChunkedInput {
|
||||
}
|
||||
readBytes += localReadBytes;
|
||||
offset += localReadBytes;
|
||||
|
||||
if (readBytes == chunkSize) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return wrappedBuffer(chunk, 0, readBytes);
|
||||
|
Loading…
Reference in New Issue
Block a user