} // Read public static unsafe uint Read(this NativeReader reader, uint offset, out SingleCollection values) { values = new SingleCollection(reader, offset); uint count; offset = reader.DecodeUnsigned(offset, out count); offset = checked (offset + count * sizeof(Single)); return(offset); } // Read
public static float[] ToArray(this SingleCollection collection) { int count = collection.Count; float[] result = new float[count]; int i = 0; foreach (float element in collection) { result[i++] = element; } Debug.Assert(i == count); return(result); }
} // Read public static unsafe uint Read(this NativeReader reader, uint offset, out SingleCollection values) { values = new SingleCollection(reader, offset); uint count; offset = reader.DecodeUnsigned(offset, out count); offset = checked(offset + count * sizeof(Single)); return offset; } // Read