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; }
public static Byte[] ReadByteArray(this ObjectReader reader) { var length = reader.ReadInt32(); return(reader.ReadBuffer(length)); }
public static object ReadReference(this ObjectReader reader) { var index = reader.ReadInt32(); return(reader.ReferenceContainer[index]); }