Skip to content
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

Copying one MappedLByteArray into another MappedLByteArray #71

Open
huntc opened this issue Jan 24, 2020 · 1 comment
Open

Copying one MappedLByteArray into another MappedLByteArray #71

huntc opened this issue Jan 24, 2020 · 1 comment

Comments

@huntc
Copy link

huntc commented Jan 24, 2020

It doesn't appear as though there's a straightforward way of copying the contents of a buffer produced by LArray.mmap into another buffer produced by LArray.mmap. LArray.mmap returns a MappedLByteArray whereas its copyTo method requires the target to be an LByteArray.

Any advice? Thanks.

@huntc
Copy link
Author

huntc commented Jan 24, 2020

For reference: my work-around is this:

UnsafeUtil.unsafe.copyMemory(
  sourceBuffer.address,
  targetBuffer.address + targetOffset,
  sourceBuffer.length
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant