@SuppressWarnings("unchecked")
	private void readFile() throws IOException {
		synchronized (file) {
			if (!file.exists()) {
				autoincrement = 0;
				cache = new HashMap<Object, Object>();
				writeFile();
			} else {
				// Hooray Java 7 try resource closing!
				try (FileInputStream fis = new FileInputStream(file);
						ObjectInputStream ois = new ObjectInputStream(fis)) {

					int autoinc = ois.readInt();
					Object cacheObj = ois.readObject();
					synchronized (cacheLock) {
						autoincrement = autoinc;
						cache = (HashMap<Object, Object>) cacheObj;
					}
	
				} catch (IOException ex) {
					throw ex;
				} catch (ClassNotFoundException ex) {
					IOException iox = new IOException("Unable to load persistence");
					iox.initCause(ex);
					throw iox;
				}
			}
		}
	}