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

bulkTranfer #5

Open
frankbenoit opened this issue Aug 8, 2016 · 0 comments
Open

bulkTranfer #5

frankbenoit opened this issue Aug 8, 2016 · 0 comments

Comments

@frankbenoit
Copy link

Hi,

I think the LibUsb.c bulkTransfer(...) function is not implemented correctly.
It is using a ByteBuffer to receive the data to be transmitted. But it is not evaluating/updating the position/limit fields.
It only retrieves the array pointer and uses the capacity.
That forces the callee code to allocate the ByteBuffer for each call. It could have better performance if the starting to read at position, updates the read amount of bytes by increasing the position and take the limit into account (instead of the capacity).

This would make the "transferred" parameter no more needed.

Frank

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