Advance the cursor in data buffer 'length' bytes.
(self, length)
| 83 | return result |
| 84 | |
| 85 | def advance(self, length): |
| 86 | """Advance the cursor in data buffer 'length' bytes.""" |
| 87 | new_position = self._position + length |
| 88 | if new_position < 0 or new_position > len(self._data): |
| 89 | raise Exception( |
| 90 | f"Invalid advance amount ({length}) for cursor. Position={new_position}" |
| 91 | ) |
| 92 | self._position = new_position |
| 93 | |
| 94 | def rewind(self, position=0): |
| 95 | """Set the position of the data buffer cursor to 'position'.""" |
no outgoing calls
no test coverage detected