protected void openFiles(String indexDirectory_p) throws Exception{
//        RandomAccessFile offsetFile=null;
//        RandomAccessFile databaseFile=null;
        //With persistent buffers
        File offset_f=new File(indexDirectory+"/offsets.dat");
        File database_f=new File(indexDirectory+"/database.dat");
        File indexDirectory_f=new File(indexDirectory);
        if(!indexDirectory_f.exists())
            indexDirectory_f.mkdir();
        
        if(offsetFile==null)
            offsetFile=new RandomAccessFile(offset_f,"rw");
        if(databaseFile==null)
            databaseFile=new RandomAccessFile(database_f,"rw");/**/


        
        // with MemoryMappedBuffers
/*        if(offsets==null){
            offsetFile=new RandomAccessFile(offset_f,"rw");
            offsets=offsetFile.getChannel().map(java.nio.channels.FileChannel.MapMode.READ_WRITE,0,offsetFile.length());
        }
        if(database==null){
            databaseFile=new RandomAccessFile(database_f,"rw");
            database=databaseFile.getChannel().map(java.nio.channels.FileChannel.MapMode.READ_WRITE,0,databaseFile.length());
        };/**/
        
        
        
    }