/**
  * Writes an {@link IndexRoutingTable} to a {@link StreamOutput}.
  *
  * @param index {@link IndexRoutingTable} to write
  * @param out {@link StreamOutput} to write to
  * @throws IOException if something happens during write
  */
 public static void writeTo(IndexRoutingTable index, StreamOutput out) throws IOException {
   out.writeString(index.index());
   out.writeVInt(index.shards.size());
   for (IndexShardRoutingTable indexShard : index) {
     IndexShardRoutingTable.Builder.writeToThin(indexShard, out);
   }
 }
 public static void writeTo(IndexShardRoutingTable indexShard, StreamOutput out)
     throws IOException {
   out.writeString(indexShard.shardId().index().name());
   writeToThin(indexShard, out);
 }