SimpleJSON.JSONNode.Deserialize C# (CSharp) Метод

Deserialize() публичный статический Метод

public static Deserialize ( System aReader ) : JSONNode
aReader System
Результат JSONNode
		public static JSONNode Deserialize(System.IO.BinaryReader aReader)
		{
			JSONBinaryTag type = (JSONBinaryTag)aReader.ReadByte();
			switch (type)
			{
				case JSONBinaryTag.Array:
					{
						int count = aReader.ReadInt32();
						JSONArray tmp = new JSONArray();
						for (int i = 0; i < count; i++)
							tmp.Add(Deserialize(aReader));
						return tmp;
					}
				case JSONBinaryTag.Class:
					{
						int count = aReader.ReadInt32();
						JSONClass tmp = new JSONClass();
						for (int i = 0; i < count; i++)
						{
							string key = aReader.ReadString();
							var val = Deserialize(aReader);
							tmp.Add(key, val);
						}
						return tmp;
					}
				case JSONBinaryTag.Value:
					{
						return new JSONData(aReader.ReadString());
					}
				case JSONBinaryTag.IntValue:
					{
						return new JSONData(aReader.ReadInt32());
					}
				case JSONBinaryTag.DoubleValue:
					{
						return new JSONData(aReader.ReadDouble());
					}
				case JSONBinaryTag.BoolValue:
					{
						return new JSONData(aReader.ReadBoolean());
					}
				case JSONBinaryTag.FloatValue:
					{
						return new JSONData(aReader.ReadSingle());
					}

				default:
					{
						throw new Exception("Error deserializing JSON. Unknown tag: " + type);
					}
			}
		}

Usage Example

        // Token: 0x06000284 RID: 644 RVA: 0x0000B59C File Offset: 0x0000979C
        public static JSONNode LoadFromStream(Stream aData)
        {
            JSONNode result;

            using (BinaryReader binaryReader = new BinaryReader(aData))
            {
                result = JSONNode.Deserialize(binaryReader);
            }
            return(result);
        }
All Usage Examples Of SimpleJSON.JSONNode::Deserialize