protected void writeAttributes(GrowableConstantPool constantPool,
			DataOutputStream output) throws IOException {
		int count = getKnownAttributeCount();
		if (unknownAttributes != null)
			count += unknownAttributes.size();
		output.writeShort(count);
		writeKnownAttributes(constantPool, output);
		if (unknownAttributes != null) {
			Iterator i = unknownAttributes.entrySet().iterator();
			while (i.hasNext()) {
				Map.Entry e = (Map.Entry) i.next();
				String name = (String) e.getKey();
				byte[] data = (byte[]) e.getValue();
				output.writeShort(constantPool.putUTF8(name));
				output.writeInt(data.length);
				output.write(data);
			}
		}
	}