[jboss-user] [Tomcat, HTTPD, Servlets & JSP] - Reading ServletInputStream with byte array size

gigsvoo do-not-reply at jboss.com
Thu May 15 06:04:09 EDT 2008


Hi there,

I been testing using the following code when reading ServletInputStream of HttpServletRequest during doPost() with fixed size byte array without problem:


  | servletInputStream = request.getInputStream();
  | byte[] inputBytes = new byte[1000];
  | while (servletInputStream.read(inputBytes) != -1) {
  | 	log.debug("reading inputstream...");
  | }
  | 

But when I change the byte array to unlimited/variable size, then I had infinite loop situation. My testing was done under remote debug attach mode.

What is the solution to have non-fix size byte array?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4150986#4150986

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4150986



More information about the jboss-user mailing list