Exemplo n.º 1
0
 public Class read(Kryo kryo, Input input, Class<Class> type) {
   Registration registration = kryo.readClass(input);
   int isPrimitive = input.read();
   Class typ = registration != null ? registration.getType() : null;
   if (typ == null || !typ.isPrimitive()) return typ;
   return (isPrimitive == 1) ? typ : getWrapperClass(typ);
 }
Exemplo n.º 2
0
 public EnumSet read(Kryo kryo, Input input, Class<EnumSet> type) {
   Registration registration = kryo.readClass(input);
   EnumSet object = EnumSet.noneOf(registration.getType());
   Serializer serializer = registration.getSerializer();
   int length = input.readInt(true);
   for (int i = 0; i < length; i++) object.add(serializer.read(kryo, input, null));
   return object;
 }