c4d.storage.MemoryFileStruct

class c4d.storage.MemoryFileStruct

This class is used to write to memory instead of to a file.

See also

MemoryFileData.py for an example showing how to write/read data to/from a memory file and MemoryFileBitmap.py to see how to write/read a bitmap to/from a memory file.

Methods Signatures

MemoryFileStruct.__init__(self)
rtype:c4d.storage.MemoryFileStruct
MemoryFileStruct.SetMemoryReadMode(self, adr, size) Sets the buffer read from a memory block instead of from a file.
MemoryFileStruct.SetMemoryWriteMode(self) Sets the buffer ready to be written to.
MemoryFileStruct.GetData(self) Retrieves all data written to the memory file.

Methods Documentation

MemoryFileStruct.__init__(self)
Return type:c4d.storage.MemoryFileStruct
Returns:The memory file object.
MemoryFileStruct.SetMemoryReadMode(self, adr, size)

Sets the buffer read from a memory block instead of from a file.

Parameters:
  • adr (Union[c4d.storage.ByteSeq, str]) – The memory address to read from.
  • size (int) – The size of the memory block, or -1 if the buffer is “big enough”.
MemoryFileStruct.SetMemoryWriteMode(self)

Sets the buffer ready to be written to.

MemoryFileStruct.GetData(self)

Retrieves all data written to the memory file.

Return type:tuple(ByteSeq, int)
Returns:A tuple with the buffer data and size.