private void ensureCapacity ( ) { if ( size < selectionKeys . length ) { return ; } SelectionKey [ ] newArray = new SelectionKey [ selectionKeys . length * 2 ] ; System . arraycopy ( selectionKeys , 0 , newArray , 0 , size ) ; selectionKeys = newArray ; }
Multiply the size of array twice