Parameter outputFileName is not used.
The input file opened for output too (why?). Why is the openmode ate used?
There is no check on whether the read() succeeded - the value of count is not checked until after the buffer has been processed.
Assuming the input file should be unchanged, and the encoded version should be written to the output file, this might do. Note the files are opened in binary mode. Text mode can do translation of some characters such as line endings which may not be useful if the file is to be encoded/decoded.
From C++11 a string does use a contiguous block of memory. In earlier versions to be safe one could use a std::vector<char> which would always give a contiguous allocation.