private String readLine( final ChannelBuffer buf )
throws IOException
{
int startIndex = buf.readerIndex();
ChannelBufferInputStream stream = new ChannelBufferInputStream( buf.slice() );
String line = stream.readLine();
int newIndex = startIndex + line.length();
buf.readerIndex( newIndex );
return line;
}