public Name
relativize(Name origin) {
	if (origin == null || !subdomain(origin))
		return this;
	Name newname = new Name();
	copy(this, newname);
	int length = length() - origin.length();
	int labels = newname.labels() - origin.labels();
	newname.setlabels(labels);
	newname.name = new byte[length];
	System.arraycopy(name, offset(0), newname.name, 0, length);
	return newname;
}
If this name is a subdomain of origin, return a new name relative to
origin with the same value. Otherwise, return the existing name.
@param origin The origin to remove.
@return The possibly relativized name.
src/main/java/core/org/xbill/DNS/Name.java