title: Getting the full InputStream
body: <p>I am working on a Web Server, I am stuck on the HTTP method PUT ... I currently can only bet 10 bytes of data from the client when he tries to upload a file, bellow is what I have so far.</p>
  
  <pre><code>InputStream stream = connection.getInputStream();
  OutputStream fos = Files.newOutputStream(path); 
  
  int count = 0;
  
  while (count &lt; 10) {
    int b = stream.read();
    if (b == -1) break;
  
    fos.write(b);
    ++count;
  }
  fos.close();
  </code></pre>
  
  <p>Please tell me how I can get the as much input the client writes.</p>