@Override protected T buildResult(HttpContext context) throws Exception { if (buf != null) clientResponse.setConnection(new ContentInputStream(buf)); return responseExtractor.extractResult(clientResponse); }
public static byte[] readContentBytes(HttpResponse resp, String enc) throws IOException { ContentBufferEntity entity = (ContentBufferEntity) resp.getEntity(); ContentInputStream in = (ContentInputStream) entity.getContent(); byte barr[] = new byte[in.available()]; int read = in.read(barr); if ( "gzip".equals(enc) ) { barr = unGZip(barr, read); } in.close(); return barr; }
/** * Creates new instance of ContentBufferEntity. * * @param entity the original entity. * @param buffer the content buffer. */ public ContentBufferEntity(final HttpEntity entity, final ContentInputBuffer buffer) { super(); Args.notNull(entity, "HTTP entity"); this.wrappedEntity = entity; setContent(new ContentInputStream(buffer)); }
@Override protected T buildResult(HttpContext context) throws Exception { if (buf != null) clientResponse.setConnection(new ContentInputStream(buf)); return responseExtractor.extractResult(clientResponse); }
/** * Creates new instance of ContentBufferEntity. * * @param entity the original entity. * @param buffer the content buffer. */ public ContentBufferEntity(final HttpEntity entity, final ContentInputBuffer buffer) { super(); Args.notNull(entity, "HTTP entity"); this.wrappedEntity = entity; setContent(new ContentInputStream(buffer)); }
@Override protected T buildResult(HttpContext context) throws Exception { if (buf != null) clientResponse.setConnection(new ContentInputStream(buf)); return responseExtractor.extractResult(clientResponse); }
inputBuffer == null ? null : new ContentInputStream(inputBuffer), response, outMsgContext, endptPrefix));
= new SharedInputBuffer(cfg.getBufferSize(), conn, allocator); context.setAttribute(REQUEST_SINK_BUFFER, inputBuffer); is = new ContentInputStream(inputBuffer); } else { is = null;