Example usage for org.apache.http.impl.nio.client InternalState getTmpbuf

List of usage examples for org.apache.http.impl.nio.client InternalState getTmpbuf

Introduction

In this page you can find the example usage for org.apache.http.impl.nio.client InternalState getTmpbuf.

Prototype

public ByteBuffer getTmpbuf() 

Source Link

Usage

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 w w  .  j a v  a2 s  .c  o  m*/
    if (state.getFinalResponse() != null) {
        final HttpAsyncResponseConsumer<?> responseConsumer = state.getResponseConsumer();
        responseConsumer.consumeContent(decoder, ioctrl);
    } else {
        final ByteBuffer tmpbuf = state.getTmpbuf();
        tmpbuf.clear();
        decoder.read(tmpbuf);
    }
}