* @param decoder the content decoder in use
*/
public void inputReady(final NHttpClientConnection conn, final ContentDecoder decoder) {
HttpContext context = conn.getContext();
HttpResponse response = conn.getHttpResponse();
ContentInputBuffer inBuf = (ContentInputBuffer) context.getAttribute(RESPONSE_SINK_BUFFER);
try {
int bytesRead = inBuf.consumeContent(decoder);
if (metrics != null && bytesRead > 0) {
if (metrics.getLevel() == MetricsCollector.LEVEL_FULL) {
metrics.incrementBytesReceived(getMessageContext(conn), bytesRead);
} else {
metrics.incrementBytesReceived(bytesRead);