">>" operation will ignore whitespaces by default, in order to avoid this ignorance! you should set "noskipws" falg, There are other flags too, for example "skipws" or "hex", These flags are called "manipulators" in c++ and you can read about them in here.
In this situation you should modify your code and add "noskipws":
while (!mySource.eof())
{
// code
mySource >> std:noskipws >>buffer;
myOutput << recBuffer;
}