equal
deleted
inserted
replaced
169 yield |
169 yield |
170 |
170 |
171 def read_chunk(self, offset, length): |
171 def read_chunk(self, offset, length): |
172 """Read a chunk of bytes from the file. |
172 """Read a chunk of bytes from the file. |
173 |
173 |
174 Accepts an absolute offset, length to read, and an optional existing |
174 Accepts an absolute offset, length to read. |
175 file handle to read from. |
|
176 |
|
177 If an existing file handle is passed, it will be seeked and the |
|
178 original seek position will NOT be restored. |
|
179 |
175 |
180 Returns a str or buffer of raw byte data. |
176 Returns a str or buffer of raw byte data. |
181 |
177 |
182 Raises if the requested number of bytes could not be read. |
178 Raises if the requested number of bytes could not be read. |
183 """ |
179 """ |