예제 #1
0
        public T[] ReadArray <T>()
        {
            var length   = ReadInt32();
            var res      = new T[length];
            var baseType = typeof(T);

            for (var i = 0; i < length; i++)
            {
                res[i] = (T)XdrConverter.Deserialize(this, baseType);
            }
            return(res);
        }
예제 #2
0
        public List <T> ReadList <T>()
        {
            var length   = ReadInt32();
            var res      = new List <T>(length);
            var baseType = typeof(T);

            for (var i = 0; i < length; i++)
            {
                res[i] = (T)XdrConverter.Deserialize(this, baseType);
            }
            return(res);
        }
예제 #3
0
 public object ReadObject(Type targetType)
 {
     return(XdrConverter.Deserialize(this, targetType));
 }
예제 #4
0
 public override void WriteObject(object value, Type type)
 {
     XdrConverter.Serialize(value, this);
 }