Skip the rest of the chunk. If you are not interested in the contents of the chunk, this method should be called so that the file points to the start of the next chunk.
(self)
| 199 | return data |
| 200 | |
| 201 | def skip(self): |
| 202 | """Skip the rest of the chunk. |
| 203 | If you are not interested in the contents of the chunk, |
| 204 | this method should be called so that the file points to |
| 205 | the start of the next chunk. |
| 206 | """ |
| 207 | |
| 208 | if self.closed: |
| 209 | raise ValueError("I/O operation on closed file") |
| 210 | if self.seekable: |
| 211 | try: |
| 212 | n = self.chunksize - self.size_read |
| 213 | # maybe fix alignment |
| 214 | if self.align and (self.chunksize & 1): |
| 215 | n = n + 1 |
| 216 | self.file.seek(n, 1) |
| 217 | self.size_read = self.size_read + n |
| 218 | return |
| 219 | except OSError: |
| 220 | pass |
| 221 | while self.size_read < self.chunksize: |
| 222 | n = min(8192, self.chunksize - self.size_read) |
| 223 | dummy = self.read(n) |
| 224 | if not dummy: |
| 225 | raise EOFError |
| 226 | |
| 227 | |
| 228 | class Wave_read: |