System.Runtime.Remoting.RemotingServices.MarshalToBuffer C# (CSharp) Méthode

MarshalToBuffer() static private méthode

static private MarshalToBuffer ( Object o ) : byte[]
o Object
Résultat byte[]
        internal static byte[] MarshalToBuffer(Object o)
        {
            // serialize headers and args together using the binary formatter
            MemoryStream stm = new MemoryStream();
            RemotingSurrogateSelector ss = new RemotingSurrogateSelector();
            BinaryFormatter fmt = new BinaryFormatter();                
            fmt.SurrogateSelector = ss;
            fmt.Context = new StreamingContext(StreamingContextStates.Other);
            fmt.Serialize(stm, o, null, false /* No Security check */);

            return stm.GetBuffer();
        }
RemotingServices