Skip to content

How to copy from dart to c and c to dart? #901

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fayfive opened this issue Nov 6, 2021 · 1 comment
Closed

How to copy from dart to c and c to dart? #901

fayfive opened this issue Nov 6, 2021 · 1 comment

Comments

@fayfive
Copy link

fayfive commented Nov 6, 2021

I read a file var list = await file.readAsBytes(); and want to copy it to clang Pointer<Uint8> buf = malloc.allocate(list.length);. I know I can do it for (var i = 0; i < list.length; i++) buf.elementAt(i).value = list[i];. Is there anther method to do it just like clang memcpy?

@dcharkes
Copy link
Collaborator

dcharkes commented Nov 12, 2021

Currently that is not yet available:

Until then, copying bytes is the way to do it.

@dcharkes dcharkes transferred this issue from dart-archive/ffi Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants