'Read `length\' elements of the FIFO buffer.
Drained data is automatically deleted.'

def read(self, length=(-1)):

    read_buf = StringIO()
    remaining = length
    while True:
        if (not self.buffers):
            break
        firstBuf = self.buffers[0]
        firstBuf.seek(self.read_pos)
        read_buf.write(firstBuf.read(remaining))
        self.read_pos = firstBuf.tell()
        if (length == (-1)):
            del self.buffers[0]
            self.read_pos = 0
        else:
            remaining = (length - read_buf.tell())
            if (remaining > 0):
                del self.buffers[0]
                self.read_pos = 0
            else:
                break
    return read_buf.getvalue()
