Javadoc
Registers all necessary classes to the
Kryo instance;
ATTENTION!
Please do not change the order of the registered classes. If new classes need to be
registered, please add this registration at the end. Otherwise the old data will not be able
to be de-serialized. If some class is not need to be register any more, do not remove the
registration. If the class is not available any more, add arbitrary class to its position, so
that the order can be maintained. Do not add unnecessary classes to the registration list.
NOTE: By default, all primitives (including wrappers) and java.lang.String are registered.
Any other class, including JDK classes like ArrayList and even arrays such as String[] or
int[] must be registered.
NOTE: If it is known up front what classes need to be serialized, registering the classes is
ideal. However, in some cases the classes to serialize are not known until it is time to
perform the serialization. When setRegistrationOptional is true, registered classes are still
written as an integer. However, unregistered classes are written as a String, using the name
of the class. This is much less efficient, but can't always be avoided.