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

		// Sort the fields by their names
		final SortedSet sorted = new TreeSet(new Comparator() {
			public int compare(Object o1, Object o2) {
				FieldEditor fe1 = (FieldEditor) o1;
				FieldEditor fe2 = (FieldEditor) o2;
				return (fe1.name().compareTo(fe2.name()));
			}
		});

		final FieldInfo[] infos = ce.fields();
		for (int i = 0; i < infos.length; i++) {
			final FieldEditor fe = new FieldEditor(ce, infos[i]);
			// Ignore private static and private transient fields
			if (fe.isPrivate() && fe.isStatic()) {
				break;

			} else if (fe.isPrivate() && fe.isTransient()) {
				break;

			} else {
				sorted.add(fe);
			}
		}

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