private byte[] readClassData(JavaFileObject classFile) throws IOException {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        byte[] buf = new byte[4096];
        InputStream classStream = classFile.openInputStream();
        int n = classStream.read(buf);
        while (n > 0) {
            bos.write(buf, 0, n);
            n = classStream.read(buf);
        }
        classStream.close();
        return bos.toByteArray();
    }