@Override
	public void readExternal(final ObjectInput in)
		throws IOException, ClassNotFoundException
	{
		_type = in.readByte();
		_object = switch (_type) {
			case TREE_NODE -> TreeNode.read(in);
			case FLAT_TREE_NODE -> FlatTreeNode.read(in);
			case TREE_PATH -> Tree.Path.read(in);
			default -> throw new StreamCorruptedException("Unknown serialized type.");
		};
	}
Creates an instance for serialization.

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