byte bytes [] = Base64.getDecoder().decode(element.getElementsByTagName("Bytes").item(0).getTextContent());
Importer imp = null;
fmd = imp.ImportFmd(bytes, Fmd.Format.ANSI_378_2004, Fmd.Format.ANSI_378_2004);
我收到取消引用空指针的警告,如何在 ImportFmd 方法中解决此警告? 我正在使用数字角色 SDK。
最佳答案
您需要一个 Importer
类的实例来调用 ImportFmd
方法。
一些谷歌搜索发现您可以通过这种方式获取 Importer
实例:
UareUGlobal.GetImporter()
所以你的代码变成:
byte bytes [] = Base64.getDecoder().decode(element.getElementsByTagName("Bytes").item(0).getTextContent());
Importer imp = UareUGlobal.GetImporter();
fmd = imp.ImportFmd(bytes, Fmd.Format.ANSI_378_2004, Fmd.Format.ANSI_378_2004);
关于java - 如何解决取消引用空指针的问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34584918/