Missing methods in MemorySegment class

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Thu Oct 20 10:59:50 UTC 2022


That is a good point.

I think getAtIndex with bytes was originally left out, since it was 
essentially a replica for get/byte.

But the boolean one is not, since it's doing a conversion, so at least 
that one should be there - and then I agree that, for uniformity, it 
feels strange not to have them all.

Maurizio

On 20/10/2022 11:46, Red IO wrote:
> The convenience methods
> getAtIndex(layout, index)
> setAtIndex(layout, index, value)
> Are missing for the primitive types byte and boolean. I see no reason 
> to exclude them since they simply calculate the required offset based 
> on layout and index.


More information about the panama-dev mailing list