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