[#SizeComputer] = SizeComputer :mrdocs: Stream‐like object that only records how many bytes a serialization would write. == Synopsis Declared in `<serialize.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class SizeComputer; ---- == Member Functions [cols="1,4"] |=== | Name| Description | xref:SizeComputer/2constructor.adoc[`SizeComputer`] [.small]#[constructor]# | Construct a size computer with a zero byte count. | xref:SizeComputer/seek.adoc[`seek`] | Pretend this many bytes are written, without specifying them. | xref:SizeComputer/size.adoc[`size`] | Return the total number of bytes recorded so far. | xref:SizeComputer/write.adoc[`write`] | Add the size of a byte span to the running count. | xref:SizeComputer/operator_lshift.adoc[`operator<<`] | Add the serialized size of an object to the running count. |=== == Protected Data Members [cols="1,4"] |=== | Name| Description | xref:SizeComputer/m_size.adoc[`m_size`] | Running count of bytes that would be written. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:WriteCompactSize-08.adoc[`WriteCompactSize`] | Account for a CompactSize encoding when computing a serialized size. | xref:WriteVarInt-022.adoc[`WriteVarInt`] | Account for a VarInt encoding when computing a serialized size. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#