SimpleStringTermIteratorImpl(
      MapCache mapCache, String filename, String docsFilename, String indexFilename)
      throws IOException {
    buffer = new byte[BUFFER_SIZE];

    this.docsFilename = docsFilename;
    final CachedFile cf = CachedFile.create(indexFilename);
    if (cf.exists()) {
      indexFile = cf.loadDirectory();
    } else {
      indexFile = null;
    }

    file = mapCache.copyOrOpen(filename);
    memory = file.get().memory();
    done = false;
    bufferLen = 0;
    bufferOffset = 0L;
    bufferPtr = 0;
  }