274 |
} |
} |
275 |
else if (coderResult.isUnderflow()) { |
else if (coderResult.isUnderflow()) { |
276 |
if (!allInputConsumed) { |
if (!allInputConsumed) { |
277 |
|
int nRemainingBytes |
278 |
|
= Math.max(0, byteBuffer.limit() - byteBuffer.position()); |
279 |
|
if (nRemainingBytes > 0) { |
280 |
|
byteBuffer.get(readBuffer, 0, nRemainingBytes); |
281 |
|
} |
282 |
byteBuffer.rewind(); |
byteBuffer.rewind(); |
283 |
int nread = in.read(readBuffer); |
int nread = in.read(readBuffer, nRemainingBytes, |
284 |
|
readBuffer.length - nRemainingBytes); |
285 |
if (nread < 0) { |
if (nread < 0) { |
286 |
allInputConsumed = true; |
allInputConsumed = true; |
287 |
} |
} |
288 |
byteBuffer.limit(Math.max(0, nread)); |
byteBuffer.limit(nRemainingBytes + Math.max(0, nread)); |
289 |
} |
} |
290 |
else { |
else { |
291 |
break; |
break; |