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...
generatingmemorystream 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
Post a Comment