Ejemplo n.º 1
0
        public static bool ReadValue(DeserializationContext context, out Object outVal)
        {
            BinaryElementType element = (BinaryElementType)context.Reader.ReadByte();
            BinaryValueReader reader  = GetReader(element);

            return(reader.Read(context, out outVal));
        }
Ejemplo n.º 2
0
 public Type GetObjectType(DeserializationContext context)
 {
     if (mTag == BinaryTypeTag.PrimitiveType)
     {
         return(BinaryValueReader.GetPrimitiveType(mPrimitiveType));
     }
     else if (mTag == BinaryTypeTag.RuntimeType)
     {
         return(Type.GetType(mClassName, true));
     }
     else
     {
         Assembly assembly = context.GetAssembly(mAssembly);
         return(assembly.GetType(mClassName, true));
     }
 }
Ejemplo n.º 3
0
        public Object Deserialize(Stream serializationStream,
                                  HeaderHandler handler)
        {
            // Validate the parameters.
            if (serializationStream == null)
            {
                throw new ArgumentNullException("serializationStream");
            }

            // Wrap the stream in a binary reader.
            using (BinaryReader reader =
                       new BinaryReader(serializationStream))
            {
                DeserializationContext context = new DeserializationContext(this, reader);
                return(BinaryValueReader.Deserialize(context));
            }
        }