out.writeInt(importPackageSpec.getResolution());  Map attributes = importPackageSpec.getAttributes(); if (attributes == null) { out.writeInt(0); } else { out.writeInt(attributes.size()); Iterator iter = attributes.keySet().iterator(); while (iter.hasNext()) { String key = (String) iter.next(); String value = (String) attributes.get(key); writeStringOrNull(key, out); writeStringOrNull(value, out); } }
writeMap(out, importPackageSpec.getAttributes()); writeMap(out, importPackageSpec.getDirectives());
	private void writeImportPackageSpec(ImportPackageSpecification importPackageSpec, DataOutputStream out) throws IOException {		writeVersionConstraint(importPackageSpec, out);		// TODO this is a hack until the state dynamic loading is cleaned up		// we should only write the supplier if we are resolved		if (importPackageSpec.getBundle().isResolved())			writeExportPackageDesc((ExportPackageDescriptionImpl) importPackageSpec.getSupplier(), out);		else			out.writeByte(StateReader.NULL);		writeStringOrNull(importPackageSpec.getBundleSymbolicName(), out);		writeVersionRange(importPackageSpec.getBundleVersionRange(), out);		out.writeInt(importPackageSpec.getResolution());		Map attributes = importPackageSpec.getAttributes();		if (attributes == null) {			out.writeInt(0);		} else {			out.writeInt(attributes.size());			Iterator iter = attributes.keySet().iterator();			while (iter.hasNext()) {				String key = (String) iter.next();				String value = (String) attributes.get(key);				writeStringOrNull(key, out);				writeStringOrNull(value, out);			}		}	}