src/main/java/org/michailov/async/io/AsyncByteStreamReader.java
@Override
    protected void action() {
        try {
            int availableByteCount = _inputStream.available();
            if (availableByteCount > 0) {
                // If something is available, try to read the minimum of that and what's available to write straight in the ring buffer.
                int targetByteCount = Math.min(availableByteCount, _byteRingBuffer.getAvailableToWriteStraight());
                int actualByteCount = _inputStream.read(_byteRingBuffer.getBuffer(), _byteRingBuffer.getWritePosition(), targetByteCount);
                if (actualByteCount != 0) {
                    if (actualByteCount == Util.EOF) {
                        setEOF();
                    }
                    else {
                        // Bytes were read from the stream and written into the ring buffer.
                        // Advance the ring buffer's write position.
                        _byteRingBuffer.advanceWritePosition(actualByteCount);
                    }
                }
            }
        }
        catch (Throwable ex) {
            setEOFAndThrow(ex);
        }
    }
/**
     * "<i>action</i>" function that reads bytes from the stream and writes them to the ring buffer.   
     */
"action" function that reads bytes from the stream and writes them to the ring buffer.
" action " function that reads bytes from the stream and writes them to the ring buffer .
@Override
    protected void action() {
        try {
            int availableByteCount = _inputStream.available();
            if (availableByteCount > 0) {
                int targetByteCount = Math.min(availableByteCount, _byteRingBuffer.getAvailableToWriteStraight());
                int actualByteCount = _inputStream.read(_byteRingBuffer.getBuffer(), _byteRingBuffer.getWritePosition(), targetByteCount);
                if (actualByteCount != 0) {
                    if (actualByteCount == Util.EOF) {
                        setEOF();
                    }
                    else {
                        _byteRingBuffer.advanceWritePosition(actualByteCount);
                    }
                }
            }
        }
        catch (Throwable ex) {
            setEOFAndThrow(ex);
        }
    }
@ Override protected void action ( ) { try { int availableByteCount = _inputStream . available ( ) ; if ( availableByteCount > 0 ) { int targetByteCount = Math . min ( availableByteCount , _byteRingBuffer . getAvailableToWriteStraight ( ) ) ; int actualByteCount = _inputStream . read ( _byteRingBuffer . getBuffer ( ) , _byteRingBuffer . getWritePosition ( ) , targetByteCount ) ; if ( actualByteCount != 0 ) { if ( actualByteCount == Util . EOF ) { setEOF ( ) ; } else { _byteRingBuffer . advanceWritePosition ( actualByteCount ) ; } } } } catch ( Throwable ex ) { setEOFAndThrow ( ex ) ; } }
"<i>action</i>" function that reads bytes from the stream and writes them to the ring buffer.
" <i > action< / i > " function that reads bytes from the stream and writes them to the ring buffer .
// If something is available, try to read the minimum of that and what's available to write straight in the ring buffer.
 // Bytes were read from the stream and written into the ring buffer.
 // Advance the ring buffer's write position.
