public void pointTo ( Object baseObject , long baseOffset , int sizeInBytes ) { // Read the number of elements from the first 8 bytes. final long numElements = Platform . getLong ( baseObject , baseOffset ) ; assert numElements >= 0 : "numElements (" + numElements + ") should >= 0" ; assert numElements <= Integer . MAX_VALUE : "numElements (" + numElements + ") should <= Integer.MAX_VALUE" ; this . numElements = ( int ) numElements ; this . baseObject = baseObject ; this . baseOffset = baseOffset ; this . sizeInBytes = sizeInBytes ; this . elementOffset = baseOffset + calculateHeaderPortionInBytes ( this . numElements ) ; }
Update this UnsafeArrayData to point to different backing data .