private void flushLeftOver ( CharBuffer input ) throws IOException { if ( ! _hasLeftOver ) { return ; } for ( ; ; ) { if ( input != null && input . hasRemaining ( ) ) { _leftOverBuffer . put ( input . get ( ) ) ; } _leftOverBuffer . flip ( ) ; CoderResult cr = _encoder . encode ( _leftOverBuffer , _buffer , input == null ) ; if ( cr . isUnderflow ( ) ) { if ( _leftOverBuffer . hasRemaining ( ) ) { _leftOverBuffer . compact ( ) ; } else { break ; } } if ( cr . isOverflow ( ) ) { flushBufferToWriter ( ) ; } } _hasLeftOver = false ; _leftOverBuffer . clear ( ) ; }
Flushes the left - over buffer . Characters from the input buffer are used to add more data to the _leftOverBuffer in order to make the flush happen .