Exemple #1
0
        public T Deserialize <T>(BinaryReader reader)
            where T : IPortableObject
        {
            var dataLength = reader.ReadInt32();
            var data       = reader.ReadBytes(dataLength);
            var pofReader  = new PofReader(context, SlotSourceFactory.CreateWithSingleSlot(data));

            return(pofReader.ReadObject <T>(0));
        }
Exemple #2
0
        public object Deserialize(BinaryReader reader, SerializationFlags serializationFlags, Type type)
        {
            var data      = ReadPofFrame(reader, serializationFlags);
            var pofReader = new PofReader(context, slotSourceFactory.CreateWithSingleSlot(data));

            if (serializationFlags.HasFlag(SerializationFlags.Typeless))
            {
                return(pofReader.ReadObjectTypeless(0, type));
            }
            else
            {
                return(pofReader.ReadObject(0));
            }
        }