Flushes this encoder. This method will call #implFlush(ByteBuffer) implFlush. Some encoders may need to write some bytes to the output buffer when they have read all input characters, subclasses can overridden #implFlush(ByteBuffer) implFlush to perform writing action. The ma
(ByteBuffer out)
| 565 | * for the last boolean parameter. |
| 566 | */ |
| 567 | public final CoderResult flush(ByteBuffer out) { |
| 568 | if (status != END && status != READY) { |
| 569 | throw new IllegalStateException(); |
| 570 | } |
| 571 | CoderResult result = implFlush(out); |
| 572 | if (result == CoderResult.UNDERFLOW) { |
| 573 | status = FLUSH; |
| 574 | } |
| 575 | return result; |
| 576 | } |
| 577 | |
| 578 | /** |
| 579 | * Flushes this encoder. The default implementation does nothing and always |