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;
 }
Example #2
0
 public static string ReadStringOrReference(this ObjectReader reader)
 {
     return(reader.Deserialize() as string);
 }
Example #3
0
 public static byte[] ReadBuffer(this ObjectReader reader, int length)
 {
     byte[] buffer = new byte[length];
     reader.Stream.Read(buffer, 0, length);
     return(buffer);
 }
Example #4
0
        public static object ReadReference(this ObjectReader reader)
        {
            var index = reader.ReadInt32();

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

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

            return(new StringBuilder(str));
        }