ReadableByteChannel inChannel = newChannel("One\r\nTwo\r\nThree");
inbuf.fill(inChannel);
CharArrayBuffer line = new CharArrayBuffer(64);
line.clear();
assertTrue(inbuf.readLine(line, false));
assertEquals("One", line.toString());
outbuf.writeLine(line);
line.clear();
assertTrue(inbuf.readLine(line, false));
assertEquals("Two", line.toString());
outbuf.writeLine(line);
line.clear();
assertFalse(inbuf.readLine(line, false));
inChannel = newChannel("\r\nFour");
inbuf.fill(inChannel);
line.clear();
assertTrue(inbuf.readLine(line, false));
assertEquals("Three", line.toString());
outbuf.writeLine(line);
inbuf.fill(inChannel);
line.clear();
assertTrue(inbuf.readLine(line, true));
assertEquals("Four", line.toString());
outbuf.writeLine(line);
line.clear();
assertFalse(inbuf.readLine(line, true));
ByteArrayOutputStream outstream = new ByteArrayOutputStream();
WritableByteChannel outChannel = newChannel(outstream);
outbuf.flush(outChannel);