D
dansan
I have been tryning to make some of our C# programs talk to some perl
programs. These perl jewels output in binary. I have been trying to
use Process.StandardOutput to read the output from the perl programs.
I am able to read the output if it is ASCII (or some char[] of some
sort). But the issues comes when it is binary info. I have tried to
use StandardOutput.BaseStream, which returns a Stream to then read the
bytes out of that Stream. This stream does not support 'searching',
therefore I can't do .Length on it... and I can't loop-until-done
because I don't know how to stop when I'm at the end of the stream.
I have tried all kinds of lines, one of which is:
byte [] buffer = new byte [size];
while ((buffer = binreader.ReadBytes(buffer.Length)) != null)
{
.... write the buffer to a binary file...
}
but that doesn't work.
I have also tried to read one byte at a time, but with no success
either.
How can I do this? Where can I read more about it?
Thanks for helping
Daniel.
programs. These perl jewels output in binary. I have been trying to
use Process.StandardOutput to read the output from the perl programs.
I am able to read the output if it is ASCII (or some char[] of some
sort). But the issues comes when it is binary info. I have tried to
use StandardOutput.BaseStream, which returns a Stream to then read the
bytes out of that Stream. This stream does not support 'searching',
therefore I can't do .Length on it... and I can't loop-until-done
because I don't know how to stop when I'm at the end of the stream.
I have tried all kinds of lines, one of which is:
byte [] buffer = new byte [size];
while ((buffer = binreader.ReadBytes(buffer.Length)) != null)
{
.... write the buffer to a binary file...
}
but that doesn't work.
I have also tried to read one byte at a time, but with no success
either.
How can I do this? Where can I read more about it?
Thanks for helping

Daniel.