public void setValues ( int [ ] values , int size ) { if ( size < 0 || size > values . length ) { throw new IAE ( "Size[%d] should be between 0 and %d" , size , values . length ) ; } ensureSize ( size ) ; System . arraycopy ( values , 0 , expansion , 0 , size ) ; this . size = size ; }
Sets the values from the given array . The given values array is not reused and not prone to be mutated later . Instead the values from this array are copied into an array which is internal to ArrayBasedIndexedInts .