'Read size bytes from the serial port. If a timeout is set it may
return less characters as requested. With no timeout it will block
until the requested number of bytes is read.'

def read(self, size=1):

    if (not self.is_open):
        raise portNotOpenError
    data = bytearray()
    try:
        while (len(data) < size):
            if (self._thread is None):
                raise SerialException('connection    failed    (reader    thread    died)')
            data += self._read_buffer.get(True, self._timeout)
    except Queue.Empty:
        pass
    return bytes(data)
