I found old, huge open source code which performs some computations on binary data stored in file on disk, output is also saved as binary file.
There is one root method
It seems that you need the functionality of fmemopen
:
http://man7.org/linux/man-pages/man3/fmemopen.3.html
Which takes a memory region and returns a file descriptor. Unfortunately, this is a POSIX function that does not have an equivalent in Windows. Memory mapped files are probably not what you want, as they take an existing file and map it to a memory region, not the other way around as with fmemopen. The only options you have are to either use fmemopen with mingw on Windows (don't know if you can do this) or roll out your own versions of fopen, fwrite and so on.