if (data==null) return;
private static void writeTemplateData(DataOutputStream stream) throws IOException{	final String nl = "\n";		final String comma = ", ";	final String quote = "\"";	final String ending = ")"+nl;	VDBTemplate data = Group.getEditingTemplateData();	 	// write comment (even if not template definition is needed) 	if (data.getComment()!=null) 		stream.writeBytes(nl+data.getComment());	// template block not needed	if ((data.getRealDescription()==null || data.getRealDescription().length()==0) && 		  data.getPorts().isEmpty())		 //data.getInputs().isEmpty() && data.getOutputs().isEmpty())		return;		// template start	stream.writeBytes(nl+DBResolver.TEMPLATE+"(");		if (data.getDescription()!=null)		stream.writeBytes(quote + data.getRealDescription() + quote);		stream.writeBytes(") {"+nl);	final String portStart = "  "+DBResolver.PORT+"(";	Iterator i = data.getPortsV().iterator();	while (i.hasNext())	{		DBPort port = (DBPort)i.next();			if (port.getComment()!=null)			stream.writeBytes(port.getComment()+nl);		stream.writeBytes(portStart+			port.getName() +			comma + quote + port.getTarget() + quote);		if (port.getDescription()!=null)			stream.writeBytes(comma + quote + "description" + quote);		stream.writeBytes(ending);	}			// template end	stream.writeBytes("}"+nl);/*		// inputs	Enumeration e = data.getInputs().keys();	while (e.hasMoreElements())	{		String key = e.nextElement().toString();		VDBFieldData fdata = (VDBFieldData)data.getInputs().get(key);		stream.writeBytes("#! "+DBResolver.TEMPLATE_INPUT+"("+			quote + key + quote +			comma + quote + fdata.getFullName() + quote +			comma + quote + data.getInputComments().get(key).toString() + quote + ending);	}		if (!data.getInputs().isEmpty()) stream.writeBytes(nl);			// outputs	e = data.getOutputs().keys();	while (e.hasMoreElements())	{		String key = e.nextElement().toString();		VDBFieldData fdata = (VDBFieldData)data.getOutputs().get(key);		stream.writeBytes("#! "+DBResolver.TEMPLATE_OUTPUT+"("+			quote + key + quote +			comma + quote + fdata.getFullName() + quote +			comma + quote + data.getOutputComments().get(key).toString() + quote + ending);	}	if (!data.getOutputs().isEmpty()) stream.writeBytes(nl);	*/}