private static function getIntegerFromBuffer($buffer, &$offset, $delimiter = 'e')
    {
        $numeric = '';
        $offsetMarker = $offset;

        while (($byte = $buffer[$offset++]) !== $delimiter) {
            $numeric .= $byte;
        }

        $integer = (int) $numeric;
        if ($numeric != $integer) {
            throw new DecodingException("Invalid integer: $numeric", $offsetMarker);
        }

        return $integer;
    }