equal
deleted
inserted
replaced
513 self.buf = collector.getvalue() |
513 self.buf = collector.getvalue() |
514 self.iterempty = True |
514 self.iterempty = True |
515 |
515 |
516 def read(self, l): |
516 def read(self, l): |
517 """Read L bytes of data from the iterator of chunks of data. |
517 """Read L bytes of data from the iterator of chunks of data. |
518 Returns less than L bytes if the iterator runs dry.""" |
518 Returns less than L bytes if the iterator runs dry.""" |
519 if l > len(self.buf) and not self.iterempty: |
519 if l > len(self.buf) and not self.iterempty: |
520 # Clamp to a multiple of self.targetsize |
520 # Clamp to a multiple of self.targetsize |
521 targetsize = self.targetsize * ((l // self.targetsize) + 1) |
521 targetsize = self.targetsize * ((l // self.targetsize) + 1) |
522 collector = cStringIO.StringIO() |
522 collector = cStringIO.StringIO() |
523 collector.write(self.buf) |
523 collector.write(self.buf) |