Merge "py38: Provide readinto() interface for RingReader"

This commit is contained in:
Zuul 2019-10-16 04:03:01 +00:00 committed by Gerrit Code Review
commit cf53fcbd94
1 changed files with 5 additions and 0 deletions

View File

@ -96,6 +96,11 @@ class RingReader(object):
line, sep, self._buffer = self._buffer.partition(b'\n')
return line + sep
def readinto(self, buffer):
chunk = self.read(len(buffer))
buffer[:len(chunk)] = chunk
return len(chunk)
@property
def md5(self):
return self._md5.hexdigest()