public void shrink ( int count ) { char [ ] keepAllocated ; if ( count == 0 ) { throw new IllegalArgumentException ( ) ; } if ( count > lastNo ) { throw new IllegalArgumentException ( count + " vs " + lastNo ) ; } lastNo -= count ; keepAllocated = pages [ 0 ] ; System . arraycopy ( pages , count , pages , 0 , lastNo + 1 ) ; pages [ lastNo + 1 ] = keepAllocated ; for ( int i = lastNo + 2 ; i < pages . length ; i ++ ) { pages [ i ] = null ; } }
Remove count pages from the beginning