Source:
<code>public HttpResponse execute() throws Exception { StringBuilder requestBody = new StringBuilder(); if (request.getEntity() != null) { String content = ObjectMapperSingleton.getContext(request.getEntity().getClass()).writer().writeValueAsString(request.getEntity()); requestBody.append(content); } else if (request.hasJson()) { requestBody.append(request.getJson()); } StringBuilder contentBuilder = new StringBuilder(); BufferedReader in = null; try { connection.setRequestMethod(request.getMethod().name()); if (requestBody.length() > 0) { System.out.println(requestBody.toString()); connection.setDoOutput(true); BufferedOutputStream out = new BufferedOutputStream(connection.getOutputStream()); out.write(requestBody.toString().getBytes()); out.flush(); } in = new BufferedReader(new InputStreamReader( connection.getInputStream())); String inputLine; while ((inputLine = in.readLine()) != null) { <START> contentBuilder.append(inputLine); <END> } } catch (IOException ex) { ex.printStackTrace(System.out); in = new BufferedReader(new InputStreamReader( connection.getErrorStream())); String inputLine; while ((inputLine = in.readLine()) != null) { contentBuilder.append(inputLine); } } finally { if (in != null) { in.close(); } } HttpResponseImpl responseImpl = HttpResponseImpl.wrap(connection.getHeaderFields(), connection.getResponseCode(), connection.getResponseMessage(), contentBuilder.toString()); connection.disconnect(); return responseImpl; }</code><technical_language>a worried this input stream converting a String. I a feeling Swift (S3) broken streaming files down, etc. pass input stream Response object if OS4j calls connectors response getInputStream for binary downloads in cases readyEntity is called apply conversion a String response object</technical_language>

Target:
public HttpResponse execute() throws Exception { StringBuilder requestBody = new StringBuilder(); if (request.getEntity() != null) { String content = ObjectMapperSingleton.getContext(request.getEntity().getClass()).writer().writeValueAsString(request.getEntity()); requestBody.append(content); } else if (request.hasJson()) { requestBody.append(request.getJson()); } StringBuilder contentBuilder = new StringBuilder(); BufferedReader in = null; try { connection.setRequestMethod(request.getMethod().name()); if (requestBody.length() > 0) { System.out.println(requestBody.toString()); connection.setDoOutput(true); BufferedOutputStream out = new BufferedOutputStream(connection.getOutputStream()); out.write(requestBody.toString().getBytes()); out.flush(); } in = new BufferedReader(new InputStreamReader( connection.getInputStream())); String inputLine; while ((inputLine = in.readLine()) != null) { contentBuilder.append(inputLine); } } catch (IOException ex) { ex.printStackTrace(System.out); in = new BufferedReader(new InputStreamReader( connection.getErrorStream())); String inputLine; while ((inputLine = in.readLine()) != null) { contentBuilder.append(inputLine); } } finally { if (in != null) { in.close(); } } HttpResponseImpl responseImpl = HttpResponseImpl.wrap(connection.getHeaderFields(), connection.getResponseCode(), connection.getResponseMessage(), connection.getInputStream()); connection.disconnect(); return responseImpl; }