public object Deserialize(ObjectReader reader)
 {
     SessionStateItemCollection items = new SessionStateItemCollection();
     var count = reader.ReadInt32();
     for(int i = 0; i < count; i++)
     {
         var name = (string)reader.Deserialize();
         var value = reader.Deserialize();
         items[name] = value;
     }
     return items;
 }
Exemple #2
0
 public static string ReadStringOrReference(this ObjectReader reader)
 {
     return(reader.Deserialize() as string);
 }
Exemple #3
0
 public static byte[] ReadBuffer(this ObjectReader reader, int length)
 {
     byte[] buffer = new byte[length];
     reader.Stream.Read(buffer, 0, length);
     return(buffer);
 }
Exemple #4
0
        public static object ReadReference(this ObjectReader reader)
        {
            var index = reader.ReadInt32();

            return(reader.ReferenceContainer[index]);
        }
        public static Char[] ReadCharArray(this ObjectReader reader)
        {
            var bytes = reader.ReadByteArray();

            return(reader.Encoding.GetChars(bytes));
        }
 public static Char ReadChar(this ObjectReader reader)
 {
     reader.Stream.Read(reader.DefaultBuffer, 0, TypeByteLength.Char);
     return(BitConverter.ToChar(reader.DefaultBuffer, 0));
 }
        public static StringBuilder ReadStringBuilder(this ObjectReader reader)
        {
            var str = reader.ReadStringOrReference();

            return(new StringBuilder(str));
        }