[#WriteVarInt-025]
= WriteVarInt
:mrdocs:

`WriteVarInt` overloads

== Synopses

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

Account for a VarInt encoding when computing a serialized size&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename I&gt;
void
xref:WriteVarInt-022.adoc[WriteVarInt](
    xref:SizeComputer.adoc[SizeComputer]& os,
    I n);
----

[.small]#xref:WriteVarInt-022.adoc[_» more&period;&period;&period;_]#

Write a value to a stream in VarInt encoding&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    typename Stream,
    xref:VarIntMode.adoc[VarIntMode] Mode,
    typename I&gt;
void
xref:WriteVarInt-0a.adoc[WriteVarInt](
    Stream& os,
    I n);
----

[.small]#xref:WriteVarInt-0a.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *os*
| The size computer to update&period;
| *n*
| The value that would be encoded as a VarInt&period;
|===


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