S
Stefan L
Hi Everybody,
I want to read an array of doubles from a BinaryReader.
Therefore I have the following loop:
int size = r.ReadInt32();
double[] values = new double[size];
for (int i = 0; i < size; i++)
values = r.ReadDouble();
But this is unbelievable slow compared to reading the size,
instanciating the array and then read the values en block as I did it
before in VB6 (File Get ...)
Is there a way to read an entire array from a Reader or Stream or
something similar to speed this up? We said we wanted to stay in managed
code, so I do not want to write a C-Function to accomplish this.
TIA,
Stefan
I want to read an array of doubles from a BinaryReader.
Therefore I have the following loop:
int size = r.ReadInt32();
double[] values = new double[size];
for (int i = 0; i < size; i++)
values = r.ReadDouble();
But this is unbelievable slow compared to reading the size,
instanciating the array and then read the values en block as I did it
before in VB6 (File Get ...)
Is there a way to read an entire array from a Reader or Stream or
something similar to speed this up? We said we wanted to stay in managed
code, so I do not want to write a C-Function to accomplish this.
TIA,
Stefan