@Override
	public void readExternal(final ObjectInput in)
		throws IOException, ClassNotFoundException
	{
		_type = in.readByte();
		_object = switch (_type) {
			case EVOLUTION_DURATIONS -> EvolutionDurations.read(in);
			case EVOLUTION_INIT -> EvolutionInit.read(in);
			case EVOLUTION_PARAMS -> EvolutionParams.read(in);
			case EVOLUTION_RESULT -> EvolutionResult.read(in);
			case EVOLUTION_START -> EvolutionStart.read(in);
			default -> throw new StreamCorruptedException("Unknown serialized type.");
		};
	}
Creates an instance for serialization.

@param type  the type
@param object  the object
jenetics/src/main/java/io/jenetics/engine/SerialProxy.java