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

Buffer documentation #17

Open
Z-Kris opened this issue Jun 28, 2024 · 0 comments
Open

Buffer documentation #17

Z-Kris opened this issue Jun 28, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Z-Kris
Copy link
Contributor

Z-Kris commented Jun 28, 2024

Buffer functions have incomplete documentation right now. Additionally, the documentation that does exist is rather confusing (even to myself as I wrote them).
Ideally the documentation should provide a breakdown of the bytes in a table format, e.g. as an example:

| Byte | Modification | Shift |
|:----:|:------------:|:-----:|
|   0  |       0      |   8   |
|   1  |     +128     |   0   |

Which would be the documentation for the p2Alt2 function:

public fun ByteBuf.p2Alt2(value: Int): ByteBuf {
    writeByte(value shr 8)
    writeByte(value + 128)
    return this
}

I believe this is much easier to understand than trying to break down the modifications to each byte in text format, particularly for the more complex cases such as p4Alt* where there are four bytes to try to explain.

@Z-Kris Z-Kris added the enhancement New feature or request label Jun 28, 2024
@Z-Kris Z-Kris self-assigned this Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant