byte b = buf.get();
if (b == '\n') {
int end = buf.position();
int sz = end - start;
byte[] body = new byte[sz];
buf.reset(); // go back to mark
buf.get(body, 0, sz - 1); // read data
buf.get(); // read '\n'
buf.mark(); // new mark.
start = buf.position();
String s = new String(body);