title: CompletionException: NPE trying to read inputStream async
body: <p>I am trying to read, in an async way, a file that i receive from the client. The idea is to recipt the file, validate it and if the validations are ok, send a response to the client saying that all it's ok, and process the file in background, so the user doesn't need to wait until the file is procesed.</p>
  <p>For that I receive the file in my resource like an inputStrem:</p>
  <pre><code>@Override
  @POST
  @Path(&quot;/bulk&quot;)
  @Consumes(&quot;text/csv&quot;)
  @Produces(MediaType.APPLICATION_JSON)
  public Response importEmployees(InputStream inputStream) {
      if(fileIsNotValid(inputStream)){
          throw exceptionFactoryBean.createBadRequestException(&quot;there was an error with the file&quot;);
      }
  try {
          CompletableFuture.runAsync(() -&gt; {
      employeeService.importEmployees(inputStream);
          }).exceptionally(e -&gt; {
              LOG.error(format(ERROR_IMPORTING_FILE, e.getMessage()));
              return null;
          });
      } catch (RuntimeException e) {
          LOG.error(format(ERROR_SENDING_EMAIL, e.getMessage()));
          throw exceptionFactoryBean.createServiceException(&quot;payment-method.export.installment-schema.error&quot;);
      }
      return Response.ok().build();
  }
  </code></pre>
  <p>For the async part I used the runAsync() method of CompletableFuture.
  However, inside of my employeeService.importEmployees() method I tried to read the inputStream and I am getting a java.util.concurrent.CompletionException: java.lang.NullPointerException</p>
  <pre><code>public List&lt;ImportResult&gt; importEmployees(final InputStream inputStream) {    
  byte[] buffer = new byte[1024];
      int len;
      try {
          while ((len = inputStream.read(buffer)) &gt; -1) {
              baos.write(buffer, NumberUtils.INTEGER_ZERO, len);
          }
  </code></pre>
  <p>The inputStream is not null. And debuging in a low level, I can see that the wrapper of the class Http11InputBuffer is null when i try to read the inputStream.
  Do you can see what errors i have or how i can set the wrapper attribute of the Http11InputBuffer previous to read the inputStream</p>