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

gomobile Reader.Read should take offset and length params #3326

Merged
merged 5 commits into from Oct 21, 2019

Conversation

kaloyan-raev
Copy link
Member

@kaloyan-raev kaloyan-raev commented Oct 21, 2019

What: Reader.Read in gomobile accepts offset and length params.

In addition, this PR fixes a bug in the usage of length in Writer.Write method.

Why: This allows more optimal usage from Java code. Java does not have slices like in Golang, but achieves the same on byte arrays with the usage of offset and length.

Please describe the tests:

  • Existing tests adapted

Please describe the performance impact:

Code Review Checklist (to be filled out by reviewer)

  • Does the PR describe what changes are being made?
  • Does the PR describe why the changes are being made?
  • Does the code follow our style guide?
  • Does the code follow our testing guide?
  • Is the PR appropriately sized? (If it could be broken into smaller PRs it should be)
  • Does the new code have enough tests? (every PR should have tests or justification otherwise. Bug-fix PRs especially)
  • Does the new code have enough documentation that answers "how do I use it?" and "what does it do?"? (both source documentation and higher level, diagrams?)
  • Does any documentation need updating?
  • Do the database access patterns make sense?

@kaloyan-raev kaloyan-raev requested a review from a team October 21, 2019 12:57
@cla-bot cla-bot bot added the cla-signed label Oct 21, 2019
@ghost ghost requested review from mobyvb and navillasa and removed request for a team October 21, 2019 12:57
@kaloyan-raev kaloyan-raev merged commit 244fea7 into master Oct 21, 2019
@kaloyan-raev kaloyan-raev deleted the orange/read-off-len branch October 21, 2019 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants