private void writeObject(ObjectOutputStream oos) throws IOException {
  oos.defaultWriteObject();
  oos.writeInt(index.size());
  for (int i=0, sz=index.size(); i < sz; ++i) {
    oos.writeUTF(index.get(i));
  }
}

private void writeObject ( ObjectOutputStream oos ) throws IOException { oos . defaultWriteObject ( ) ; oos . writeInt ( index . size ( ) ) ; for ( int i = 0 , sz = index . size ( ) ; i < sz ; ++ i ) { oos . writeUTF ( index . get ( i ) ) ; } }
custom serializer . this is possible since the index is guaranteed to assign contiguous values .
