title: Reading binary data from file in Python and passing it to a C++ function
body: <p>How to pass binary data loaded by Python directly from a file to a C++ function taking data pointer and size called in a Cython module?</p>
  
  <pre><code>loadFromMemory(const void*, size_t)
  </code></pre>
  
  <p>This is probably how it would look like in pure Python:</p>
  
  <pre><code>with open('file.bin', 'rb') as f:
      data = f.read()
      loadFromMemory(data, len(data))  # How to do this in Cython?
  </code></pre>