List of usage examples for org.apache.http.nio.protocol HttpAsyncResponseConsumer consumeContent
void consumeContent(ContentDecoder decoder, IOControl ioctrl) throws IOException;
From source file:org.apache.http.impl.nio.client.MainClientExec.java
@Override public void consumeContent(final InternalState state, final ContentDecoder decoder, final IOControl ioctrl) throws IOException { if (this.log.isDebugEnabled()) { this.log.debug("[exchange: " + state.getId() + "] Consume content"); }//from w ww . j a va 2 s . c om if (state.getFinalResponse() != null) { final HttpAsyncResponseConsumer<?> responseConsumer = state.getResponseConsumer(); responseConsumer.consumeContent(decoder, ioctrl); } else { final ByteBuffer tmpbuf = state.getTmpbuf(); tmpbuf.clear(); decoder.read(tmpbuf); } }
From source file:org.apache.http.impl.nio.client.PipeliningClientExchangeHandlerImpl.java
@Override public void consumeContent(final ContentDecoder decoder, final IOControl ioctrl) throws IOException { if (this.log.isDebugEnabled()) { this.log.debug("[exchange: " + getId() + "] Consume content"); }/*from w w w . j av a2 s. c o m*/ final HttpAsyncResponseConsumer<T> responseConsumer = this.responseConsumerRef.get(); Asserts.check(responseConsumer != null, "Inconsistent state: response consumer is null"); responseConsumer.consumeContent(decoder, ioctrl); }