'Read as much as possible, but not more than length.'

def _ReadPartial(self, length):

    chunk = (self.offset / self.chunksize)
    chunk_offset = (self.offset % self.chunksize)
    if (chunk > self.last_chunk):
        return ''
    available_to_read = min(length, (self.chunksize - chunk_offset))
    fd = self._GetChunkForReading(chunk)
    fd.seek(chunk_offset)
    result = fd.read(available_to_read)
    self.offset += len(result)
    return result
