src/main/java/org/michailov/async/io/AsyncCharEncoder.java
private void encodeToTempBuffer() {
        // Take a snapshot of the real char buffer.
        // (The real byte buffer is not needed now.)
        int readPosition = _charRingBuffer.getReadPosition();

        // Map the virtual decoder char buffer over the native char buffer. 
        _mainCharBuffer.position(readPosition);
        _mainCharBuffer.limit(readPosition + 1);
        
        // Reset the virtual temp buffer.
        _tempByteBuffer.clear();
        
        // Attempt to decode.
        _charsetEncoder.reset();
        CoderResult coderResult = _charsetEncoder.encode(_mainCharBuffer, _tempByteBuffer, ENCODE_AS_EOF);
        
        if (!coderResult.isError()) {
            // Adjust the position on the physical char buffer. 
            _charRingBuffer.advanceReadPosition(1);
            
            // Flip the temp buffer and mark it as dirty.
            _tempByteBuffer.flip();
            _isTempBufferDirty = true;
        }
    }
/**
     * Encodes 1 char to the temp byte buffer.
     */
Encodes 1 char to the temp byte buffer.
Encodes 1 char to the temp byte buffer .
private void encodeToTempBuffer() {
        int readPosition = _charRingBuffer.getReadPosition();
        _mainCharBuffer.position(readPosition);
        _mainCharBuffer.limit(readPosition + 1);
        _tempByteBuffer.clear();
        _charsetEncoder.reset();
        CoderResult coderResult = _charsetEncoder.encode(_mainCharBuffer, _tempByteBuffer, ENCODE_AS_EOF);
        if (!coderResult.isError()) {
            _charRingBuffer.advanceReadPosition(1);
            _tempByteBuffer.flip();
            _isTempBufferDirty = true;
        }
    }
private void encodeToTempBuffer ( ) { int readPosition = _charRingBuffer . getReadPosition ( ) ; _mainCharBuffer . position ( readPosition ) ; _mainCharBuffer . limit ( readPosition + 1 ) ; _tempByteBuffer . clear ( ) ; _charsetEncoder . reset ( ) ; CoderResult coderResult = _charsetEncoder . encode ( _mainCharBuffer , _tempByteBuffer , ENCODE_AS_EOF ) ; if ( ! coderResult . isError ( ) ) { _charRingBuffer . advanceReadPosition ( 1 ) ; _tempByteBuffer . flip ( ) ; _isTempBufferDirty = true ; } }
Encodes 1 char to the temp byte buffer.
Encodes 1 char to the temp byte buffer .
// Take a snapshot of the real char buffer.
 // (The real byte buffer is not needed now.)
 // Map the virtual decoder char buffer over the native char buffer. 
 // Reset the virtual temp buffer.
 // Attempt to decode.
 // Adjust the position on the physical char buffer. 
 // Flip the temp buffer and mark it as dirty.
