About
Using MemoryFileStruct one can read/write from/into memory using a file class.
- Note
- The MAXON API ALIASES equivalent is maxon::IoMemoryInterface.
Typical use cases:
A general example on writing into a HyperFile in memory:
if (hf == nullptr || mfs == nullptr)
void* rawData = nullptr;
mfs->
GetData(rawData, rawDataSize,
false);
This is how one can easily transfer an object (or a complete hierarchy) via network:
if (op == nullptr)
if (mfs == nullptr)
void* rawData = nullptr;
mfs->
GetData(rawData, rawDataSize,
false);
void* rawData = nullptr;
ReceiveFromNetwork(rawData, rawDataSize);
if (!rawData || rawDataSize == 0)
if (op == nullptr)
Allocation/Deallocation
MemoryFileStruct objects are created with the usual tools, see Entity Creation and Destruction Manual (Classic).
Writing Data to a File in Memory and Accessing the Raw Data
Reading Data From a File in Memory
Further Reading