public void rebuildCache() {
    	try {
	        for (int i = 0; i < indexFiles.length; i++) {
	            CacheIndice index = indices.get(i);
	            ArrayList<ByteArray> files = index.getFiles();
	            int currentFile = 0;
	            for (ByteArray data : files) {
	                int file = currentFile++;
	                if (data != null) {
	                    index.put(file, data.length, data.getBytes(), false);
	                }
	            }
	        }
    	} catch (IOException e) {
    		e.printStackTrace();
    	}
    }