@Override
	public void writeExternal(final ObjectOutput out) throws IOException {
		out.writeByte(_type);
		switch (_type) {
			case DOUBLE_GENE -> ((DoubleGene)_object).write(out);
			case INTEGER_GENE -> ((IntegerGene)_object).write(out);
			case LONG_GENE -> ((LongGene)_object).write(out);
			case BIT_CHROMOSOME -> ((BitChromosome)_object).write(out);
			case DOUBLE_CHROMOSOME -> ((DoubleChromosome)_object).write(out);
			case INTEGER_CHROMOSOME -> ((IntegerChromosome)_object).write(out);
			case LONG_CHROMOSOME -> ((LongChromosome)_object).write(out);
			case CHARACTER_CHROMOSOME -> ((CharacterChromosome)_object).write(out);
			case PERMUTATION_CHROMOSOME -> ((PermutationChromosome<?>)_object).write(out);
			case GENOTYPE -> ((Genotype<?>)_object).write(out);
			case PHENOTYPE -> ((Phenotype<?, ?>)_object).write(out);
			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/SerialProxy.java