lastBuffer = (int[]) bufferArrayList.get(bufferArrayList.size() - 1);
lastBufferIndex = Math.min((size>>n), bufferArrayList.size() - 1); lastBuffer = (int[]) bufferArrayList.get(lastBufferIndex);
public void store(int[] input){    if (input == null) {        throw new IllegalArgumentException("context buffer can't store a null pointer");    }    //if (input.length != incSize) {        // throw a derivative of runtime exceptions    //    throw new NavException("Store: Input size doesn't match increment size");    //}    // no additional buffer space needed    int[] lastBuffer;    if (bufferArrayList.size() == 0) {        lastBuffer = new int[pageSize];        bufferArrayList.add(lastBuffer);        capacity = pageSize;    } else {        lastBuffer = (int[]) bufferArrayList.get(bufferArrayList.size() - 1);    }    if ((this.size + input.length) < this.capacity) {        //get the last buffer from the bufferListArray        //obtain the starting offset in that buffer to which the data is to be copied        //update length        //System.arraycopy(input, 0, lastBuffer, size % pageSize, input.length);        System.arraycopy(input, 0, lastBuffer, size & r, input.length);        //System.out.println("     --+++  buffer size "+size);        size += input.length;    } else // new buffers needed        {        // compute the number of additional buffers needed        int k =            //((int) ((input.length + size) / pageSize))                ((input.length + size) >>n)                //+ (((input.length + size) % pageSize) > 0 ? 1 : 0)                + (((input.length + size) & r ) > 0 ? 1 : 0)                -  (capacity >> n);        // create these buffers        // add to bufferArrayList        //System.arraycopy(input, 0, lastBuffer, size % pageSize, capacity - size);        System.arraycopy(input, 0, lastBuffer, size & r, capacity - size);        for (int i = 0; i < k; i++) {            int[] newBuffer = new int[pageSize];            if (i < k - 1) {                // full copy                 System.arraycopy(input, pageSize * i + capacity - size, newBuffer, 0, pageSize);            } else {                // last page                System.arraycopy(                    input,                    pageSize * i + capacity - size,                    newBuffer,                    0,                    (input.length + size) - pageSize * i - capacity);            }            bufferArrayList.add(newBuffer);        }        // update length        size += input.length;        // update capacity        capacity += (k <<n);        // update    }}