StringBuilder builder = new StringBuilder();
while (reader.read(buffer) != -1) {
buffer.flip();
logger.debug("read {} characters", buffer.remaining());
counterGroup.addAndGet("characters.received",
Long.valueOf(buffer.limit()));
builder.append(buffer.array(), buffer.position(), buffer.length());