code: public void saveToWriter(Writer bw) throws IOException {
      for (int i = 0, sz = size(); i < sz; i++) {
        bw.write(i + "=" + get(i) + '\n');
      }
    }
docs: This saves the contents of this index into string form, as part of a larger
  text-serialization.  This is not intended to act as a standalone routine,
  instead being called from the text-serialization routine for a component
  that makes use of an Index, so everything can be stored in one file.  This is
  similar to <code>saveToFileName</code>.
  @param bw Writer to save to.
  @throws IOException Exception thrown if cannot save.