public void run() throws IOException, ClassNotFoundException {
        int i = 0;
        if (outFile != null) {
            /* Everything goes to one big file... */
            ByteArrayOutputStream bout = new ByteArrayOutputStream(8192);
            writeFileTop(bout); /* only once */

            for (i = 0; i < classes.length; i++) {
                write(bout, classes[i]);
            }

            writeIfChanged(bout.toByteArray(), outFile);
        } else {
            /* Each class goes to its own file... */
            for (i = 0; i < classes.length; i++) {
                ByteArrayOutputStream bout = new ByteArrayOutputStream(8192);
                writeFileTop(bout);
                ClassDoc clazz = classes[i];
                write(bout, clazz);
                writeIfChanged(bout.toByteArray(), getFileName(clazz.qualifiedName()));
            }
        }
    }