private Program loadLibrary(String libraryName, FSRL libraryFsrl, LoadSpec desiredLoadSpec,
			List<String> libraryNameList, List<Option> options, Object consumer, MessageLog log,
			TaskMonitor monitor) throws CancelledException, IOException {

		try (ByteProvider provider =
			createLibraryByteProvider(libraryFsrl, desiredLoadSpec, log, monitor)) {

			LoadSpec libLoadSpec = matchSupportedLoadSpec(desiredLoadSpec, provider);
			if (libLoadSpec == null) {
				log.appendMsg("Skipping library which is the wrong architecture: " + libraryFsrl);
				return null;
			}

			return doLoad(provider, libraryName, libLoadSpec, libraryNameList,
				options, consumer, log, monitor);
		}
	}
Imports a library file into a ghidra project. Use this method if you already have
a {@link ByteProvider} available.

@param libraryName The name of the library to load
@param libraryFsrl The library {@link FSRL} to load
@param desiredLoadSpec The desired {@link LoadSpec}
@param libraryNameList A {@link List} to be populated with the given library's dependent
  library names
@param options The load options
@param log The log
@param consumer A consumer object for {@link DomainObject}s generated
@param monitor A cancelable task monitor
@return The loaded {@link Program}, or null if the load was not successful
@throws CancelledException if the user cancelled the load operation
@throws IOException if there was an IO-related error during the load
Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/AbstractLibrarySupportLoader.java