/// <summary> /// Loads a read only array from a value stream /// </summary> /// <param name="stream">The stream to load from</param> /// <returns>The read only array</returns> public static ReadOnlyArray <T> Load(IValueStream stream) { var loader = Value <T> .Loader; List <T> temp = new List <T>(); stream.EnterArray(); while (stream.Next != StreamOp.LeaveArray) { temp.Add(loader(stream)); } stream.LeaveArray(); return(new ReadOnlyArray <T>(temp)); }