def read(self, n=None):
        read_buffer = StringIO()

        if n is not None:
            # Read a fixed amount of bytes

            left_to_read = n
            while left_to_read > 0:
                # Keep reading from the buffer

                read_from_buffer = self._buffer.read(left_to_read)

                if len(read_from_buffer) == 0:
                    read_buffer.write(unicode(read_from_buffer))
                elif len(read_from_buffer) < left_to_read:
                    # We read less than the remaining bytes. Fetch more rows.

                    self._fetch_rows()
                    self._write_rows_onto_buffer()

                    if len(self._buffer.getvalue()) == 0L:
                        # There are no more rows, break the loop
                        break

                left_to_read -= len(read_from_buffer)
        else:
            # Read all the rows

            while True:
                read_from_buffer = self._buffer.read()

                if len(read_from_buffer) > 0:
                    read_buffer.write(read_from_buffer)
                else:
                    # We emptied the buffer. Fetch more rows.

                    self._fetch_rows()
                    self._write_rows_onto_buffer()

                    if len(self._buffer.getvalue()) == 0L:
                        # There are no more rows, break the loop
                        break

        read_result = read_buffer.getvalue()
        read_buffer.close()

        return read_result
dataset/ETHPy150Open abarto/rowstextio/rowstextio.py/RowsTextIO.read/operator `>` -> `==`