title: Collect logs ZIP and upload to Http service without temp file
body: <p>I need to create a utility that collect a set of logs zip them and attach them to jira.</p>
  
  <p>I am planning to use httpclient 4.5. (has NIO support) The jira API is not an issue here.</p>
  
  <p>I would like to stream files directly from file system via zip stream and upload to jira without the need to create a temporary zip file on the file system.</p>
  
  <p>I found the java API confusing in such case and failed to figure out the usage.
  Attentively it looks like such case is a good candidate for java NIO usage (maybe a channel?) but failed to find a good example.</p>
  
  <p>As a starting point I created an example that upload one file from but I am failing to take it to the next step of Zip stream.</p>
  
  <pre><code>HttpClient httpClient = createHttpClient();
  
  
  final String issueUriAttach = issueUri + "/" + "attachments";
  
  HttpPost postRequest = new HttpPost(issueUriAttach);
  final FileInputStream fileInputStream = new FileInputStream("README.md");
  InputStream in = new InputStream() {
      @Override
      public int read() throws IOException {
          return 0;
      }
  
      @Override
      public int read(byte[] b, int off, int len) throws IOException {
          return fileInputStream.read(b,off,len);
      }
  };
  InputStreamBody inputStreamBody = new InputStreamBody(in,"README.csv");
  HttpEntity reqEntity = MultipartEntityBuilder.create()
          .setContentType(ContentType.MULTIPART_FORM_DATA)
          .addPart("file", inputStreamBody)
          .build();
  postRequest.setHeader(getAuthHeader());
  postRequest.setHeader(getNocheckHeader());
  
  postRequest.setEntity(reqEntity);
  final HttpResponse response = httpClient.execute(postRequest);
  </code></pre>
  
  <p>As I said I am not limited to java I/O java NIO is an option as well.. </p>