Aligned long views over byte arrays and heap ByteBuffers

MacGregor, Duncan (GE Energy Management) duncan.macgregor at
Wed Jan 20 15:01:31 UTC 2016

On 20/01/2016, 14:15, "valhalla-dev on behalf of Paul Sandoz"
<valhalla-dev-bounces at on behalf of
paul.sandoz at> wrote:

>> On 20 Jan 2016, at 14:27, Vitaly Davidovich <vitalyd at> wrote:
>>How about alignIndex(int,int)?
>That might work, although it implies returning an aligned index rather
>than a modulus associated with the current index and unit size. I think
>that would be more precise if we include boolean argument for rounding
>up/down to the nearest aligned index:
>  alignedIndex(int index, int unitSize, boolean roundUp)
>For rounding down a negative value might be returned. I still prefer a
>modulus returning method.

I kind of agree that alignedIndex suggests an actual index is returned.
How about alignedOffset, or alignedDistance maybe?


More information about the valhalla-dev mailing list