private void writeMethods(final DataOutputStream out, final Set onlyMethods)
			throws IOException {
		if (onlyMethods != null) {
			out.writeShort(onlyMethods.size());

		} else {
			if (Method.DEBUG) {
				System.out.println("Writing " + methods.length + " methods");
			}
			out.writeShort(methods.length);
		}

		for (int i = 0; i < methods.length; i++) {
			if ((onlyMethods != null) && onlyMethods.contains(methods[i])) {
				continue;
			}
			methods[i].write(out);
		}
	}