ArchiveSizeis a type that stores an arbitrary size value (both in-memory and writes that value into the stream as well). It has two accompanying types:ProxyandAnchor, which are both virtual, utility types, and they work together to achieve the function ofArchiveSize. WhenArchiveSizeis encountered during the serialization process, at first an empty size (zero) value will be written into the stream and the position of that size value will be captured in an in-memory variable. Later, when its associatedAnchoris encountered, it will capture the current stream position as the base (start) offset, from which the size is going to be computed (size is relative to some base offset). Lastly, when its ArchiveSize::Proxy is encountered, the current stream position will be captured, and the earlier captured anchor base offset will be subtracted from it (resulting in the size value - the size betweenAnchoroffset andProxyoffset). With the size value computed, it will update the in-memory value stored inArchiveSizewith it. Then, it will seek the stream to the earlier captured position of the size value (where zeros were written initially), and it will write the size value into the stream at that position. With all that done, it will seek back to the position of the stream before the proxy was encountered, and resume serialization.