> + this.faultHandler = faultHandler; > + } > + > + @Override > + protected HttpResponse invoke(HttpURLConnection connection) throws > IOException, InterruptedException { > + HttpResponse originalResponse = super.invoke(connection); > + HttpResponse.Builder<?> responseBuilder = originalResponse.toBuilder(); > + > + if (hasPayload(originalResponse) && hasServerError(originalResponse)) { > + InputStream in = null; > + InputStream originalInputStream = > originalResponse.getPayload().openStream(); > + if (originalInputStream instanceof ByteArrayInputStream) > + in = originalInputStream; > + else > + try { > + in = new > ByteArrayInputStream(ByteStreams.toByteArray(originalInputStream));
Add a comment explaining why we are buffering the response in memory here. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds-labs/pull/72/files#r22237965