code: protected Response streamResponse(String type, InputStream inputStream, int contentLength) {
      return Response.ok(new StreamingOutputImpl(inputStream), type)
        .header("Content-Length", contentLength)
        .build();
    }
docs: Creates streamed response from input stream
  
  @param inputStream data
  @param type content type
  @param contentLength content length
  @return Response