Class ClassFileUtil


  • public class ClassFileUtil
    extends Object
    Utility class for working with Java class files.
    • Constructor Detail

      • ClassFileUtil

        public ClassFileUtil()
    • Method Detail

      • saveClassFile

        public static void saveClassFile​(byte[] classBytes,
                                         String directoryPath,
                                         String className)
                                  throws IOException
        Saves a byte array as a .class file in the specified directory.
        Parameters:
        classBytes - the byte array representing the class file content
        directoryPath - the path to the directory where the .class file should be saved
        className - the fully qualified name of the class (e.g., "com.tonic.ANewClass")
        Throws:
        IOException - if an I/O error occurs during writing
        IllegalArgumentException - if the className is null or empty