コード例 #1
0
        static private void Serialize(object input, ISerializationContext context, Type expected)
        {
            byte[] array = NetDataContractSerializerHelper.Serialize(input);

            context.StreamWriter.Write(array.Length);
            context.StreamWriter.Write(array);
        }
コード例 #2
0
        static private object Deserialize(Type expected, IDeserializationContext context)
        {
            var len = context.StreamReader.ReadInt();

            return(NetDataContractSerializerHelper.Deserialize(context.StreamReader.ReadBytes(len)));
        }