def METHOD_NAME(self):
    _buffer_size = self._io_buffer.tell()
    if not _buffer_size:
        return
    self._io_buffer.seek(0)
    # read and reset the buffer
    data = self._io_buffer.read(_buffer_size)
    self._io_buffer.seek(0)
    # handle the buffered data and store
    lines = data.split(b'\n')
    ansi_csi_re = re.compile(b"\001?\033\\[((?:\\d|;)*)([a-dA-D])\002?")
    def _handle_csi(line):
        def _remove_csi(line):
            return re.sub(ansi_csi_re, b'', line)
        for match in ansi_csi_re.finditer(line):
            arg, command = match.groups()
            arg = int(arg.decode()) if arg else 1
            if command == b'A':  # cursor up
                self._line_counter -= arg
            if command == b'B':  # cursor down
                self._line_counter += arg
        return _remove_csi(line)
    line = None
    log_lines = []
    for line in lines:
        # handle cursor up and down symbols
        line = _handle_csi(line)
        # handle each line for carriage returns
        line = line.rsplit(b'\r')[-1]
        log_lines.append((line.decode(), self._line_counter))
        self._line_counter += 1
    self.logs_collected(log_lines=log_lines)
    self._line_counter -= 1
    # if there was no b'\n' at the end of the data keep the last line in buffer for further writing
    if line != b'':
        self._io_buffer.write(line)