title: Uploading a file in Jersey without using multipart
body: <p>I run a web service where I convert a file from one file format into another. The conversion logic is already functioning but now, I want to query this logic via Jersey. Whenever file upload via Jersey is addressed in tutorials / questions, people describe how to do this using multipart form data. I do however simply want to send and return a single file and skip the overhead of sending multiple parts. (The webservice is triggered by another machine which I control so there is no HTML form involved.)</p>
  
  <p>My question is how would I achieve something like the following:</p>
  
  <pre><code>@POST
  @Path("{sessionId"}
  @Consumes("image/png")
  @Produces("application/pdf")
  public Response put(@PathParam("sessionId") String sessionId, 
                      @WhatToPutHere InputStream uploadedFileStream) {
    return BusinessLogic.convert(uploadedFile); // returns StreamingOutput - works!
  }
  </code></pre>
  
  <p>How do I get hold of the <code>uploadedFileStream</code> (It should be some annotation, I guess which is of course not <code>@WhatToPutHere</code>). I figured out how to directly return a file via <code>StreamingOutput</code>.</p>
  
  <p>Thanks for any help!</p>