Change SerialPort class to be compatible with DataInput interface.