Reader¶
Methods
- defread
- defread_until
- class zcached.Reader(payload)[source]¶
Bases:
objectImplementation of the reader interface which helps reading data from raw bytes.
- Parameters:
payload (
bytes) – Payload to read.
- buffer¶
Provided payload.
- position¶
Current reader position.
- read_until(element)[source]¶
Method to read bytes from the buffer until the specified element is encountered.
- Parameters:
element (
bytes) – The byte sequence indicating the end of reading.- Raises:
RuntimeError – There is no specific item in the buffer starting from the current position.
- Return type:
Notes
This method reads bytes from the buffer until the specified element is encountered. It starts reading from the current position in the buffer.