public final InputStream getBody() throws IOException { if (body == null) { InputStream raw = openBody(); if (raw != null) { body = new ExcerptInputStream(raw); } } return body; }
/** @return an excerpt from the data copied. */ @SuppressWarnings("resource") public static byte[] copyAll(InputStream from, OutputStream into) throws IOException { final ExcerptInputStream ex = new ExcerptInputStream(from); ex.copyAll(into); return ex.getExcerpt(); }
HttpEntityEnclosingRequestBase entityEnclosingMethod = isPost ? new HttpPost(url) : new HttpPut(url); if (body != null) { ExcerptInputStream e = new ExcerptInputStream(body); excerpt = e.getExcerpt(); String length = request.removeHeaders(HttpMessage.CONTENT_LENGTH);