code: public void write() throws IOException
     {
        SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Object>()
        {
           public Object run() throws Exception
           {
              // do not write if not dirty
              if (!dirty)
              {
                 return null;
              }
  
              OutputStream out = new IndexOutputStream(dir.createOutput(name + ".new"));
              DataOutputStream dataOut = null;
              try
              {
                 dataOut = new DataOutputStream(out);
                 dataOut.writeInt(counter);
                 dataOut.writeInt(indexes.size());
                 for (int i = 0; i < indexes.size(); i++)
                 {
                    dataOut.writeUTF(getName(i));
                 }
              }
              finally
              {
                 if (dataOut != null)
                    dataOut.close();
                 out.close();
              }
              // delete old
              if (dir.fileExists(name))
              {
                 dir.deleteFile(name);
              }
              rename(name + ".new", name);
              dirty = false;
              return null;
           }
        });
     }
docs: Writes the index infos to disk if they are dirty.
  
  @throws IOException if an error occurs.