[#ReadCompactSize]
= ReadCompactSize
:mrdocs:

Decode a CompactSize&hyphen;encoded variable&hyphen;length integer&period;

== Synopsis

Declared in `&lt;serialize&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename Stream&gt;
uint64&lowbar;t
ReadCompactSize(
    Stream& is,
    bool range&lowbar;check = true);
----

== Description

As these are primarily used to encode the size of vector&hyphen;like serializations, by default a range check is performed&period; When used as a generic number encoding, range&lowbar;check should be set to false&period;

== Return Value

The decoded integer value&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *is*
| The stream to read the CompactSize&hyphen;encoded value from&period;
| *range&lowbar;check*
| Whether to reject values larger than MAX&lowbar;SIZE&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
