Exemplo n.º 1
0
        public static IEditableVariable CopyViaBuffer(IEditableVariable source, IEditableVariable destination)
        {
            using (MemoryStream ms = new MemoryStream())
                using (BinaryWriter bw = new BinaryWriter(ms))
                {
                    source.Write(bw);

                    ms.Position = 0;

                    using (BinaryReader reader = new BinaryReader(ms))
                    {
                        destination.Read(reader, (uint)ms.Length);
                    }
                }

            return(destination);
        }