code: public int readLine(byte b[], int off, int len) throws IOException {
      int result, left = totalExpected - totalRead;
      if (left <= 0) {
        return -1;
      } else {
        result = ((ServletInputStream)in).readLine(b, off, Math.min(left, len));
      }
      if (result > 0) {
        totalRead += result;
      }
      return result;    
    }
docs: Implement length limitation on top of the <code>readLine</code> method of
  the wrapped <code>ServletInputStream</code>.
  
  @param b    an array of bytes into which data is read.
  @param off  an integer specifying the character at which
  this method begins reading.
  @param len  an integer specifying the maximum number of
  bytes to read.
  @return     an integer specifying the actual number of bytes
  read, or -1 if the end of the stream is reached.
  @exception  IOException  if an I/O error occurs.