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

[java] Provide a raw getter method for bitmaps #893

Closed
LucaMerello opened this issue Mar 24, 2022 · 2 comments
Closed

[java] Provide a raw getter method for bitmaps #893

LucaMerello opened this issue Mar 24, 2022 · 2 comments

Comments

@LucaMerello
Copy link

Exactly as it happens for enums, for which the decoder also provides a get method for the raw version of the data, for example:

 public byte exchangeCodeRaw ()
 {
     return buffer.getByte(offset + 18);
 }

 public ExchangeCode_enum exchangeCode ()
 {
     return ExchangeCode_enum.get(buffer.getByte(offset + 18));
 }

It would be useful to have the same raw information in the case of bitmaps. Now, to be able to get it, you need to have access to the buffer and the offset from outside the decoder and compose them as follows:

decoder.mMProtections().buffer().getByte(decoder.mMProtections().offset());

It would be easier and safer to get the same data in the following way:

byte bitmap = decoder.mMProtections().getRaw();

where MMProtections_setDecoder provides:

public byte getRaw()
{
    return buffer.getByte(offset);
}
@LucaMerello LucaMerello changed the title Provide a raw getter method for bitmaps (java) [java] Provide a raw getter method for bitmaps Mar 24, 2022
@tmontgomery
Copy link
Contributor

This seems useful. @mjpt777 @vyazelenko @mikeb01 what do you all think?

@mjpt777
Copy link
Contributor

mjpt777 commented Mar 24, 2022

I'd be fine with this.

mjpt777 added a commit that referenced this issue Jul 10, 2022
… method on the generated bitset decoder. Issue #893.
@mjpt777 mjpt777 closed this as completed Jul 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants