Decode a bytes string from the encoded data. Returns: A bytes object.
(size_bytes: bytes)
| 238 | return int(int_bytes) |
| 239 | |
| 240 | def decode_bytes(size_bytes: bytes) -> bytes: |
| 241 | """Decode a bytes string from the encoded data. |
| 242 | |
| 243 | Returns: |
| 244 | A bytes object. |
| 245 | """ |
| 246 | while (byte := get_byte()) != b":": |
| 247 | size_bytes += byte |
| 248 | bytes_string = get_bytes(int(size_bytes)) |
| 249 | return bytes_string |
| 250 | |
| 251 | def decode_string() -> str: |
| 252 | """Decode a (utf-8 encoded) string from the encoded data. |