HIGUCHI Yuta

Avoid creating new KryoNamespace instance.

- Avoid creating new KryoNamespace instance when there's only 1 namespace specified.

Change-Id: I7acd1af21623660d6de4f1090b0731a15762cd14
......@@ -50,7 +50,18 @@ public interface Serializer {
* @return Serializer instance
*/
static Serializer using(KryoNamespace kryo) {
return using(Arrays.asList(kryo));
return new Serializer() {
@Override
public <T> byte[] encode(T object) {
return kryo.serialize(object);
}
@Override
public <T> T decode(byte[] bytes) {
return kryo.deserialize(bytes);
}
};
}
/**
......