public static void bitSet ( MemorySegment [ ] segments , int baseOffset , int index ) { if ( segments . length == 1 ) { int offset = baseOffset + ( ( index & BIT_BYTE_POSITION_MASK ) >>> 3 ) ; MemorySegment segment = segments [ 0 ] ; byte current = segment . get ( offset ) ; current |= ( 1 << ( index & BIT_BYTE_INDEX_MASK ) ) ; segment . put ( offset , current ) ; } else { bitSetMultiSegments ( segments , baseOffset , index ) ; } }
set bit from segments .