Get an encoded byte and advance position. Raises: DecodeError: If the end of the data was reached Returns: A bytes object with a single byte.
()
| 184 | position = 0 |
| 185 | |
| 186 | def get_byte() -> bytes: |
| 187 | """Get an encoded byte and advance position. |
| 188 | |
| 189 | Raises: |
| 190 | DecodeError: If the end of the data was reached |
| 191 | |
| 192 | Returns: |
| 193 | A bytes object with a single byte. |
| 194 | """ |
| 195 | nonlocal position |
| 196 | if position >= max_position: |
| 197 | raise DecodeError("More data expected") |
| 198 | character = encoded[position : position + 1] |
| 199 | position += 1 |
| 200 | return character |
| 201 | |
| 202 | def peek_byte() -> bytes: |
| 203 | """Get the byte at the current position, but don't advance position. |
no test coverage detected
searching dependent graphs…