flush

Flushes this encoder.

Some encoders maintain internal state and may need to write some final bytes to the output buffer once the overall input sequence has been read.

Any additional output is written to the output buffer beginning at its current position. At most Buffer.remaining bytes will be written. The buffer's position will be advanced appropriately, but its mark and limit will not be modified.

If this method completes successfully then it returns . If there is insufficient room in the output buffer then it returns CoderResult.OVERFLOW. If this happens then this method must be invoked again, with an output buffer that has more room, in order to complete the current #steps.

If this encoder has already been flushed then invoking this method has no effect.

This method invokes the .implFlush method to perform the actual flushing operation.

Return

A coder-result object, either CoderResult.UNDERFLOW or CoderResult.OVERFLOW

Parameters

out

The output byte buffer

Throws

If the previous step of the current encoding operation was an invocation neither of the .flush method nor of the three-argument .encode method with a value of true for the endOfInput parameter