/** Serializer for {@link TreeMap} and any subclass.
* @author Tumi <serverperformance@gmail.com> (enhacements) */
static public class TreeMapSerializer extends MapSerializer {
public void write (Kryo kryo, Output output, Map map) {
TreeMap treeMap = (TreeMap)map;
kryo.writeClassAndObject(output, treeMap.comparator());
super.write(kryo, output, map);
}
protected Map create (Kryo kryo, Input input, Class<Map> type) {
return createTreeMap(type, (Comparator)kryo.readClassAndObject(input));