https://bz.apache.org/bugzilla/show_bug.cgi?id=59664

liujian <else.liuj...@huawei.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|INVALID                     |REMIND

--- Comment #3 from liujian <else.liuj...@huawei.com> ---
Hi:

sorry about the issuss

i see the code of the org.apache.catalina.connector.InputBuffer
    public int available() {
        int available = 0;
        if (state == BYTE_STATE) {
            available = bb.getLength();
        } else if (state == CHAR_STATE) {
            available = cb.getLength();
        }
        if (available == 0) {
            coyoteRequest.action(ActionCode.AVAILABLE, null);
            available = (coyoteRequest.getAvailable() > 0) ? 1 : 0;
        }
        return available;
    }

    public boolean ready()
        throws IOException {

        if (closed) {
            throw new IOException(sm.getString("inputBuffer.streamClosed"));
        }

        return (available() > 0);
    }


you see,if only one byte in 'bb',the 'ready()' will return 'true'
But for 'Unicode',only one byte can not read success

So, we can not use 'ready()' to get 'Reader' is available or not

i think 'ready()' of 'Reader' should imporve

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to