diff --git a/src/typedstream/stream.py b/src/typedstream/stream.py index 2444db5..295ccfb 100644 --- a/src/typedstream/stream.py +++ b/src/typedstream/stream.py @@ -122,6 +122,8 @@ _TAG_INTEGER_2 = -127 # Indicates an integer value, stored in 4 bytes. _TAG_INTEGER_4 = -126 +# Indicates an integer value, stored in 8 bytes. +_TAG_INTEGER_8 = -121 # Indicates a floating-point value, stored in 4 or 8 bytes (depending on whether it is a float or a double). _TAG_FLOATING_POINT = -125 # Indicates the start of a string value or an object that is stored literally and not as a backreference. @@ -677,6 +679,8 @@ def _read_integer(self, head: typing.Optional[int] = None, *, signed: bool) -> i return int.from_bytes(self._read_exact(2), self.byte_order, signed=signed) elif head == _TAG_INTEGER_4: return int.from_bytes(self._read_exact(4), self.byte_order, signed=signed) + elif head == _TAG_INTEGER_8: + return int.from_bytes(self._read_exact(8), self.byte_order, signed=signed) else: raise InvalidTypedStreamError(f"Invalid head tag in this context: {head} ({head & 0xff:#x})")