-
Notifications
You must be signed in to change notification settings - Fork 650
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
ByteBuffer should have a bunch of hex dump helpers #2447
Comments
Yeah this would be handy! I think I've seen something similar to this in Netty too. |
hey @natikgadzhi, I'd be happy to guide you through this 🙂 As Johannes points out the API should probably be one top-level function. However, we can break this down into a few chunks and do it bit-by-bit. I think the rough approach should be:
|
@glbrntt, thank you! Yep, the approach you laid out makes sense — I thought about the same way to build it. Let me try things out and write a rough draft — I'll put together a PR and tag you. Aiming for Wednesday. UPD: The week got out of hand, still working. I've got a simple hexdump to work — just adding the variations and the format argument. UPD2: Oh, this is what you mean by "This is where the fun starts!". |
Almost there. TODOs:
|
I frequently need at least the following kinds of functionality, no idea how many times I've implemented them in random projects:
ByteBuffer
one (long) linexxd -r -p
compatible (example42 41 42 41
)hexdump -C
compatible output (in full)hexdump -C
-compatible output but length limitedand probably there are others. This is mostly an API-design problem I think because if we're smart we can probably fit this all into one method like
buffer.hexDump(renderer: .xxdCompatible(maxLength: 1024))
or something.The text was updated successfully, but these errors were encountered: