You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2014/06/24 12:01:41 UTC

[Bug 56663] Can not get all data from InputStream in onDataAvailable

https://issues.apache.org/bugzilla/show_bug.cgi?id=56663

--- Comment #1 from Long Zou <lo...@hotmail.com> ---
public void onDataAvailable() throws IOException {
            byte[] buf = new byte[1024];
            int len = 0;
            try{
                while ( _input.isReady() && (len = _input.read(buf)) != -1) {
                    _bufferStream.write(buf, 0, len);
                }
            }catch(Exception ex){
                logger.debug(ex.getMessage());
            }
}

The client send 1406 bytes. But I can not get all.

If I changed the buf size to 2048, I can get all of 1406 bytes. But if I send
more than 2048, I can not get all again.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org