equal
deleted
inserted
replaced
461 n += readLen; |
461 n += readLen; |
462 } |
462 } |
463 |
463 |
464 return n; |
464 return n; |
465 } |
465 } |
|
466 |
|
467 // Try to use up the input stream without impact the performance too much. |
|
468 void deplete(boolean tryToRead) throws IOException { |
|
469 int remaining = is.available(); |
|
470 if (tryToRead && (remaining == 0)) { |
|
471 // try to wait and read one byte if no buffered input |
|
472 is.read(); |
|
473 } |
|
474 |
|
475 while ((remaining = is.available()) != 0) { |
|
476 is.skip(remaining); |
|
477 } |
|
478 } |
466 } |
479 } |