@Override
	public void readExternal(final ObjectInput in)
		throws IOException, ClassNotFoundException
	{
		_type = in.readByte();
		_object = switch (_type) {
			case DOUBLE_GENE -> DoubleGene.read(in);
			case INTEGER_GENE -> IntegerGene.read(in);
			case LONG_GENE -> LongGene.read(in);
			case BIT_CHROMOSOME -> BitChromosome.read(in);
			case DOUBLE_CHROMOSOME -> DoubleChromosome.read(in);
			case INTEGER_CHROMOSOME -> IntegerChromosome.read(in);
			case LONG_CHROMOSOME -> LongChromosome.read(in);
			case CHARACTER_CHROMOSOME -> CharacterChromosome.read(in);
			case PERMUTATION_CHROMOSOME -> PermutationChromosome.read(in);
			case GENOTYPE -> Genotype.read(in);
			case PHENOTYPE -> Phenotype.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/SerialProxy.java