On Jun 4, 5:37 pm, Jon Harrop <j...@ffconsultancy.comwrote:
I can read bytes from a FileStream with stream.ReadByte() but that does not
handle stdin. I can read from stdin with System.Console.In using
reader.Read() but it is 6x slower.
So how do I read bytes from stdin efficiently?
Well, one problem is that Console.In doesn't handle bytes - it handles
*characters*. I would be somewhat wary of trying to pipe non-textual
information via Console.In. There may well be a sure-fire way of
getting it to work (and Console.OpenStandardInput would be my first
port of call) but I'd still be somewhat wary.
Is this in aid of optimising the sumcol (or sumfile, the name seems to
vary) benchmark?
Jon