All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jadx.plugins.input.javaconvert.AsmUtils Maven / Gradle / Ivy

The newest version!
package jadx.plugins.input.javaconvert;

import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;

import org.objectweb.asm.ClassReader;

public class AsmUtils {

	public static String getNameFromClassFile(Path file) throws IOException {
		try (InputStream in = Files.newInputStream(file)) {
			return getClassFullName(new ClassReader(in));
		}
	}

	public static String getNameFromClassFile(byte[] content) throws IOException {
		return getClassFullName(new ClassReader(content));
	}

	private static String getClassFullName(ClassReader classReader) {
		return classReader.getClassName();
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy