currently I\'m implementing the Burrows-Wheeler transform (and inverse transform) for raw data (like jpg etc.). When testing on normal data like textfiles no problems occur.
Use read() to read in the data.
Since you are interested in getting data from the stdin, use
fd = fcntl(STDIN_FILENO, F_DUPFD, 0);
to obtain the fd of stdin.
More info here.
The issue has something to do with the fact that windows treats 0x1a a.k.a. CTRL+Z as the EOF. As Earlz pointed out, opening it in binary mode fixes this on windows and works on linux too.