Show More
@@ -916,14 +916,13 b' class chunkbuffer(object):' | |||||
916 | targetsize is how big a buffer to try to maintain.""" |
|
916 | targetsize is how big a buffer to try to maintain.""" | |
917 | self.iter = iter(in_iter) |
|
917 | self.iter = iter(in_iter) | |
918 | self.buf = '' |
|
918 | self.buf = '' | |
919 | self.targetsize = 2**16 |
|
|||
920 |
|
919 | |||
921 | def read(self, l): |
|
920 | def read(self, l): | |
922 | """Read L bytes of data from the iterator of chunks of data. |
|
921 | """Read L bytes of data from the iterator of chunks of data. | |
923 | Returns less than L bytes if the iterator runs dry.""" |
|
922 | Returns less than L bytes if the iterator runs dry.""" | |
924 | if l > len(self.buf) and self.iter: |
|
923 | if l > len(self.buf) and self.iter: | |
925 |
# Clamp to a multiple of |
|
924 | # Clamp to a multiple of 2**16 | |
926 |
targetsize = max(l, |
|
925 | targetsize = max(l, 2**16) | |
927 | collector = [str(self.buf)] |
|
926 | collector = [str(self.buf)] | |
928 | collected = len(self.buf) |
|
927 | collected = len(self.buf) | |
929 | for chunk in self.iter: |
|
928 | for chunk in self.iter: |
General Comments 0
You need to be logged in to leave comments.
Login now