public int putRef(int tag, Reference ref) {
		String className = ref.getClazz();
		String typeSig = ref.getType();
		if (tag == FIELDREF)
			TypeSignature.checkTypeSig(typeSig);
		else
			TypeSignature.checkMethodTypeSig(typeSig);

		int classIndex = putClassType(className);
		int nameIndex = putUTF8(ref.getName());
		int typeIndex = putUTF8(typeSig);
		int nameTypeIndex = putIndexed(NAMEANDTYPE, ref.getName(), nameIndex,
				typeIndex);
		return putIndexed(tag, className, classIndex, nameTypeIndex);
	}