Hi, I'm starting to use this library I'm facing with a problem that I can't resolve...
The thing is that I'm using a stream retrieved from a ftp folder, and before use in the CsvReader, I'm parsing that stream to a MemoryStream...
The thing is that with that parsing, the CsvReader it doesn't retrieve any records...
I don't know why, because the MemoryStream is fine... everything seems to be ok,... in fact, it doesn't throw me any exception... but I know that this csv has records, and some how, it doesn't retrieve them.
Here is the code that I'm using just as an example:
static void Main(string args)
using (var streamReader = new StreamReader([CsvPath])
var memoryStream = ReadFully(streamReader.BaseStream);
using (CsvReader csv = new CsvReader(memoryStream))
* here csv.DataRecords it telling me 'Enumeration yielded no results'
static MemoryStream ReadFully(Stream input)
byte buffer = new byte[16 * 1024];
MemoryStream ms = new MemoryStream();
while ((read = input.Read(buffer, 0, buffer.Length)) > 0)
ms.Write(buffer, 0, read);
The thing is that, if I remove the parsing to a memoryStream, and just use the BaseStream of the StreamReader it works fine...
BUT I NEED TO PARSE TO A MEMORY STREAM, BECAUSE I'M RETRIVING A STREAM FROM A FTP, AND I'M USING IT IN ANOTHER PLACES...
Thanks in advance!!