def METHOD_NAME(self):
    remaining = len(self.chunk) - self.chunk_offset
    if not remaining:
        try:
            chunk = next(self.chunk_iterator)
            self.chunk = memoryview(chunk)
        except StopIteration:
            self.exhausted = True
            return 0  # EOF
        self.chunk_offset = 0
        remaining = len(self.chunk)
    return remaining