c# - StringReader or Memory Stream which is resource friendly? -



c# - StringReader or Memory Stream which is resource friendly? -

i have module responsible parsing csv info received different user via website interface, , have parse csv. considering use, textfieldparser it.

but before implement considering shall improve approach...

generating memorystream info received, or initialising stringreader same input string.

which 1 improve & why?

option 1 won't give string @ all, if want work byte array , buffers, go way seems unlikely. if you're doing string processing recommend alternative 2, because can read line @ time.

as far can see reason utilize memorystream if need more complex stringreader doesn't handle want (otherwise you're reinventing wheel): encodings, unusual line formats, etc.

having worked big files (specifically csv files) stringreaders, i've never had problem. i'd wager when ms designed stringreader you're trying do, made resource-friendly possible.

c# vb.net

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -