I\'m trying to write the contents of buf pointer to the file created by ofstream.
For some reason the file is empty, however the contents of buf is never empty... What
the error is in line
ofstr << *buf;
it should be
ofstr << buf;