private static void writeMethods(final ClassEditor ce,
			final DataOutputStream dos) throws IOException {

		// Sort constructors by their names and signatures
		final SortedSet sorted = new TreeSet(new Comparator() {
			public int compare(Object o1, Object o2) {
				MethodEditor me1 = (MethodEditor) o1;
				MethodEditor me2 = (MethodEditor) o2;

				String d1 = me1.name() + me1.type().descriptor();
				String d2 = me2.name() + me2.type().descriptor();
				return (d1.compareTo(d2));
			}
		});

		final MethodInfo[] methods = ce.methods();
		for (int i = 0; i < methods.length; i++) {
			final MethodEditor me = new MethodEditor(ce, methods[i]);
			if (!me.isPrivate() && !me.isConstructor()
					&& !me.name().equals("<clinit>")) {
				// Ignore private methods
				sorted.add(me);
			}
		}

		final Iterator iter = sorted.iterator();
		while (iter.hasNext()) {
			final MethodEditor me = (MethodEditor) iter.next();
			dos.writeUTF(me.name());
			dos.writeInt(SerialVersionUID.getModifiers(me));
			dos.writeUTF(me.type().descriptor());
		}

	}