'Return size bytes from stream. If internal buffer is empty,
read another block from the stream.'

def __read(self, size):

    c = len(self.buf)
    while (c < size):
        buf = self.fileobj.read(self.bufsize)
        if (not buf):
            break
        self.buf += buf
        c += len(buf)
    buf = self.buf[:size]
    self.buf = self.buf[size:]
    return buf
