title: Wiremock withBodyFile OutOfMemoryError for large files
body: <p>In the following stub request, I use <code>withBodyFile</code> which loads large files (<code>&gt;300MB</code>) from specific locations on local disk using streams:</p>
  <pre><code>public void mockGetUrlContent(String url) {
      stubFor(get(urlEqualTo(url))
              .willReturn(ok()
                      .withBodyFile(FilenameUtils.getName(url))));
  }
  </code></pre>
  <p>Once the stub is being called, wiremock tries to complete a served event and in order to log the response it uses the <code>from</code> <a href="https://github.com/wiremock/wiremock/blob/23729a1049765d532682aa9c1b7031086436c594/src/main/java/com/github/tomakehurst/wiremock/http/LoggedResponse.java#L49" rel="nofollow noreferrer">method</a> below:</p>
  <pre><code>  public static LoggedResponse from(Response response) {
      return new LoggedResponse(
          response.getStatus(),
          response.getHeaders() == null || response.getHeaders().all().isEmpty()
              ? null
              : response.getHeaders(),
          response.getBody(),
          response.getFault());
    }
  </code></pre>
  <p>When reached to wiremock's <code>Response</code> <code>getBody</code> <a href="https://github.com/wiremock/wiremock/blob/6728eb79f440f561772421095d64ce3bda541fa9/src/main/java/com/github/tomakehurst/wiremock/http/Response.java#L123" rel="nofollow noreferrer">method</a> it converts the stream in to <code>byte[]</code> and in that points it blows on <code>OutOfMemoryError</code> (Java heap space).:</p>
  <pre><code>  public byte[] getBody() {
      try (InputStream stream = bodyStreamSource == null ? null : getBodyStream()) {
        return stream == null ? null : ByteStreams.toByteArray(stream);
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
    }
  </code></pre>
  <p>Any ideas about what am I doing wrong?</p>
  <p>Your help is highly appreciated!</p>