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

23 bitwise ops #24

Closed
wants to merge 6 commits into from
Closed

23 bitwise ops #24

wants to merge 6 commits into from

Conversation

nddipiazza
Copy link

@nddipiazza nddipiazza commented Aug 31, 2021

add a left-shift operator to Unsigned integer

TODO:

  • more useful operators that aren't trivial

@lukaseder
Copy link
Member

Thanks for your suggestion.

I don't see a reason to rush an actual implementation. This certainly requires more design. I'll keep your issue #23 open to track community interest.

@lukaseder lukaseder closed this Aug 31, 2021
@nddipiazza
Copy link
Author

Thanks @lukaseder
This is going to be very useful on a PR I'm working on for Apache Tika. We are doing some parsing of MS-FSSHTTPB file structure and all of the parsing code is written on c#. So as I'm going from C# to Java, of course there are tons of unsigned data types to deal with. So as I port the code, i'd like to switch all uint with your UInteger but it's tricky because of all the bitwise ops. Adding a few methods goes a long way.

@lukaseder
Copy link
Member

OK, how about this:

  • First we'd have to agree on naming of methods
  • Then, we'd have to make sure the methods are on all types (why just UInteger?)
  • Then, we'd have to make sure all edge cases are handled. For example, inclusiveOr(int val). What if val is negative? do we just pretend it's an unsigned int? Or, xor(long val). What if it overflows?

There are more. I don't want to spend the time on this right now (unless you have some budget?), because:

  • It won't benefit jOOQ (the primary client of this library)
  • There's not enough traction from the community yet

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.

2 participants