0 Replies Latest reply on May 15, 2008 6:04 AM by gigsvoo

    Reading ServletInputStream with byte array size

    gigsvoo Newbie

      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?