You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Christophe Marton <cm...@calendra.com> on 2001/01/22 18:16:52 UTC

ServletInputStream.available()

Hi every body,

   As you know, ServletInputStream.available() always returns 0. I don't know if this issue has been fixed or not, so I propose a fix for that Simple and really quick to code, since we just have to reach the underlying BufferedInputStream :


On org.apache.tomcat.core.BufferedServletInputStream, add:

public int available() throws IOException{
      return reqA.available();
}

On org.apache.tomcat.core.RequestImpl, add

public int available() throws java.io.IOException{
   // default
    return 0;
}
    
On HttpRequestAdapter (sin is the underlying BufferedInputStream), add

public int available() throws IOException {
     return sin.available();
}


Christophe Marton