title: Vert.x ReadStream<Buffer> to InputStream
body: <p>I am trying to set up Vert.X with Jersey to handle POST data (not necessarily form data).  </p>
  
  <p>The Jersey <code>ContainerRequest.setEntityStream</code> takes in an <code>InputStream</code> which is what I am trying to build.  However, I can't seem to get around passing that data without reading the whole thing into memory using <code>bodyHandler</code> or my own custom method that does something similar but limits the input</p>
  
  <pre><code>    final Buffer body = Buffer.buffer();
      event
          .handler(buffer -&gt; {
              if (!event.response().headWritten()) {
                  body.appendBuffer(buffer);
                  if (body.length() &gt; 10 * 1024 * 1024) {
                      event.response()
                          .setStatusCode(REQUEST_ENTITY_TOO_LARGE.getStatusCode())
                          .setStatusMessage(REQUEST_ENTITY_TOO_LARGE.getReasonPhrase())
                          .end();
                  }
              }
          })
          .endHandler(aVoid -&gt; {
              request.setEntityStream(new VertxBufferInputStream(body));
              appHandler.handle(request);
          });
  </code></pre>
  
  <p><code>VertxBufferInputStream</code> is a simple wrapper to the VertXbuffer.  Just to save some memory by avoiding converting to a ByteArrayInputStream().  But it has the whole body.</p>
  
  <p>I want to avoid having the whole body and have it streamed.  I've tried a few things all pretty hacky and bad code that eventually does not work because it blocks the event loop because the <code>handler</code> is not called and is waiting for it.</p>