sliceBlock function
Implementation
List<int> sliceBlock(List<int> buffer, int pos) {
var j = pos;
// advance until a block boundary is found
while (buffer[j] != 10 && (j - pos < 90) && j < buffer.length) {
j++;
}
if (buffer[j] == 10) {
j++;
} // append the trailing linefeed to the block
return buffer.sublist(pos, j);
}