Convert `readLine` to read buffer.

Instead of reading a string, `readLine` accepts a `Buffer` and extract
the record from the buffer.

Closes #217.