iostream interface for a serial port