@Override
	public void writeExternal(final ObjectOutput out) throws IOException {
		out.writeByte(_type);
		switch (_type) {
			case PROGRAM_CHROMOSOME -> ((ProgramChromosome<?>)_object).write(out);
			default -> throw new StreamCorruptedException("Unknown serialized type.");
		}
	}
Creates an instance for serialization.

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