public AddressArray createDynamicAddressArray(File homeDir,
                                                  int initialLength,
                                                  int batchSize,
                                                  int numSyncBatches) throws Exception {
        AddressArray addrArray;
        
        if (_indexesCached) {
            addrArray = new DynamicLongArray(batchSize, numSyncBatches, homeDir);
        } else {
            addrArray = new IOTypeLongArray(
                    Array.Type.DYNAMIC, initialLength,
                    batchSize, numSyncBatches, homeDir);
        }
        
        if(addrArray.length() < initialLength) {
            addrArray.expandCapacity(initialLength - 1);
        }
        
        return addrArray;
    }
public AddressArray createDynamicAddressArray ( File homeDir , int initialLength , int batchSize , int numSyncBatches ) throws Exception { AddressArray addrArray ; if ( _indexesCached ) { addrArray = new DynamicLongArray ( batchSize , numSyncBatches , homeDir ) ; } else { addrArray = new IOTypeLongArray ( Array . Type . DYNAMIC , initialLength , batchSize , numSyncBatches , homeDir ) ; } if ( addrArray . length ( ) < initialLength ) { addrArray . expandCapacity ( initialLength - 1 ) ; } return addrArray ; }
Creates a dynamic {@link AddressArray} which grows its capacity as needed.

@param homeDir        - the home directory where the <code>indexes.dat</code> is located.
@param initialLength  - the initial length of the created {@link AddressArray}.
@param batchSize      - the number of updates per update batch.
@param numSyncBatches - the number of update batches required for updating the underlying indexes.
@return an instance of {@link AddressArray}.
@throws Exception if an instance of {@link AddressArray} cannot be created.