Flushes this decoder. This method will call #implFlush(CharBuffer) implFlush. Some decoders may need to write some characters to the output buffer when they have read all input bytes; subclasses can override #implFlush(CharBuffer) implFlush to perform the writing operation. The
(CharBuffer out)
| 483 | * for the last boolean parameter. |
| 484 | */ |
| 485 | public final CoderResult flush(CharBuffer out) { |
| 486 | if (status != END && status != INIT) { |
| 487 | throw new IllegalStateException(); |
| 488 | } |
| 489 | CoderResult result = implFlush(out); |
| 490 | if (result == CoderResult.UNDERFLOW) { |
| 491 | status = FLUSH; |
| 492 | } |
| 493 | return result; |
| 494 | } |
| 495 | |
| 496 | /** |
| 497 | * Flushes this decoder. The default implementation does nothing and always |