private synchronized IndexPair[] getOrLoadPairs() {
		IndexPair[] pairs;
		if (cache != null && (pairs = cache.get()) != null) {
			hitCount.incrementAndGet();
			return pairs;
		}

		missCount.incrementAndGet();
		pairs = new IndexPair[size];
		FileInputStream in = null;
		try {
			in = new FileInputStream(file);
			// in.skip(startPos);
			for (int i = 0; i < size; i++) {
				IndexPair pair = readPair(in);
				pairs[i] = pair;
			}
		} catch (IOException e) {
			throw new RuntimeException(e);
		} finally {
			if (in != null)
				try {
					in.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
		}

		this.cache = new SoftReference<IndexPair[]>(pairs);

		return pairs;
	}