PackTo() 공개 메소드

Serialize specified object with specified Packer.
public PackTo ( Packer packer, object objectTree ) : void
packer Packer which packs values in .
objectTree object Object to be serialized.
리턴 void
예제 #1
0
        public static void Pack(this MessagePackSerializer source, Stream stream, object objectTree, PackerCompatibilityOptions packerCompatibilityOptions)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }

            // Packer does not have finalizer, so just avoiding packer disposing prevents stream closing.
            source.PackTo(Packer.Create(stream, packerCompatibilityOptions), objectTree);
        }