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