I am writing a program in c#.
I would like to read a binary file to the standard input of a process (it is
flac.exe to encode/decode some files).
I have tried to use the following code :
StandardInputWr iter = convertProcess. StandardInput;
[...]
byteRead = SourceFileStrea m.Read(buff,0,B UFFER_LENGTH);
StandardInputWr iter.BaseStream .Write(buff,0,b yteRead);
but it fails with somes files (whith custom chunk in the .wav input file).
However thhes files are well converted whne I use directly le flac.exe
command line. So it is the wrinting on the standard input which fails.
I think it is related to the fact that the standardInput is opened in text
mode (it uses a streamWriter).. . is there an other way to write correctly
binay data to the standard input of a process ?
Thanks for your help
O_Spring
I would like to read a binary file to the standard input of a process (it is
flac.exe to encode/decode some files).
I have tried to use the following code :
StandardInputWr iter = convertProcess. StandardInput;
[...]
byteRead = SourceFileStrea m.Read(buff,0,B UFFER_LENGTH);
StandardInputWr iter.BaseStream .Write(buff,0,b yteRead);
but it fails with somes files (whith custom chunk in the .wav input file).
However thhes files are well converted whne I use directly le flac.exe
command line. So it is the wrinting on the standard input which fails.
I think it is related to the fact that the standardInput is opened in text
mode (it uses a streamWriter).. . is there an other way to write correctly
binay data to the standard input of a process ?
Thanks for your help
O_Spring
Comment