Implement a buffer for storing output from serial-port.