/// <summary> /// Reads multiple values that were written with WriteMany. /// </summary> /// <typeparam name="T">The Type of value to read.</typeparam> /// <param name="nodeName">Unused by the <see cref="BinaryValueReader"/>.</param> /// <param name="readHandler">Delegate that reads the values from the IValueReader.</param> /// <returns>Array of the values read the IValueReader.</returns> public T[] ReadMany <T>(string nodeName, ReadManyHandler <T> readHandler) { var nodeReader = ReadNode(null); var count = nodeReader.ReadInt(null); var ret = new T[count]; for (var i = 0; i < count; i++) { ret[i] = readHandler(nodeReader, null); } return(ret); }
/// <summary> /// Reads multiple values that were written with WriteMany. /// </summary> /// <typeparam name="T">The Type of value to read.</typeparam> /// <param name="nodeName">The name of the node containing the values.</param> /// <param name="readHandler">Delegate that reads the values from the IValueReader.</param> /// <returns>Array of the values read the IValueReader.</returns> public T[] ReadMany <T>(string nodeName, ReadManyHandler <T> readHandler) { var nodeReader = ReadNode(nodeName); var count = nodeReader.ReadInt(XmlValueHelper.CountValueKey); var ret = new T[count]; for (var i = 0; i < count; i++) { var key = XmlValueHelper.GetItemKey(i); ret[i] = readHandler(nodeReader, key); } return(ret); }
/// <summary> /// Unsupported by the BitStream. /// </summary> /// <typeparam name="T">The Type of value to read.</typeparam> /// <param name="nodeName">Unused by the BitStream.</param> /// <param name="readHandler">Delegate that reads the values from the IValueReader.</param> /// <returns>Array of the values read the IValueReader.</returns> /// <exception cref="NotSupportedException">This method is not supported by the <see cref="BitStream"/>.</exception> T[] IValueReader.ReadMany <T>(string nodeName, ReadManyHandler <T> readHandler) { throw CreateNodesNotSupportedException(); }
/// <summary> /// Reads multiple values that were written with WriteMany. /// </summary> /// <typeparam name="T">The Type of value to read.</typeparam> /// <param name="nodeName">The name of the node containing the values.</param> /// <param name="readHandler">Delegate that reads the values from the IValueReader.</param> /// <returns>Array of the values read the IValueReader.</returns> public T[] ReadMany <T>(string nodeName, ReadManyHandler <T> readHandler) { return(_reader.ReadMany(nodeName, readHandler)); }