public class IOUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static ClassPool |
read(java.lang.String fileName,
boolean isLibrary)
Reads the classes from the specified jar file and returns them as a class
pool.
|
static ClassPool |
read(java.lang.String fileName,
java.lang.String classNameFilter,
boolean isLibrary,
java.util.function.BiFunction<DataEntryReader,ClassPoolFiller,DataEntryReader> extraDataEntryReader)
Reads the classes from the specified jar file and returns them as a class
pool.
|
static void |
writeJar(ClassPool programClassPool,
java.lang.String outputJarFileName)
Writes the classes from the given class pool to a specified jar.
|
static void |
writeJar(ClassPool programClassPool,
java.lang.String outputJarFileName,
java.lang.String mainClassName)
Writes the classes from the given class pool to a specified jar.
|
public static ClassPool read(java.lang.String fileName, boolean isLibrary) throws java.io.IOException
fileName - the name of the file.isLibrary - specifies whether classes should be represented as
ProgramClass instances (for processing) or
LibraryClass instances (more compact).java.io.IOExceptionpublic static ClassPool read(java.lang.String fileName, java.lang.String classNameFilter, boolean isLibrary, java.util.function.BiFunction<DataEntryReader,ClassPoolFiller,DataEntryReader> extraDataEntryReader) throws java.io.IOException
fileName - the name of the file.isLibrary - specifies whether classes should be represented as
ProgramClass instances (for processing) or
LibraryClass instances (more compact).extraDataEntryReader - Optionally provide a function that wraps the reader in another reader.java.io.IOExceptionpublic static void writeJar(ClassPool programClassPool, java.lang.String outputJarFileName) throws java.io.IOException
programClassPool - the classes to write.outputJarFileName - the name of the output jar file.java.io.IOExceptionpublic static void writeJar(ClassPool programClassPool, java.lang.String outputJarFileName, java.lang.String mainClassName) throws java.io.IOException
programClassPool - the classes to write.outputJarFileName - the name of the output jar file.java.io.IOException