KdbxKeyFile { public static byte[] load(InputStream inputStream) { String base64; try { DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); Document doc = documentBuilder.parse(inputStream); base64 = (String) xpath.evaluate(" if (base64 == null) { return null; } } catch (Exception e) { return null; } return Base64.decodeBase64(base64.getBytes()); }  static byte[] load(InputStream inputStream);  }
@Test public void testLoad() throws Exception { InputStream inputStream = getClass().getClassLoader().getResourceAsStream("KeyFileDatabase.key"); byte[] key = KdbxKeyFile.load(inputStream); assertNotNull(key); assertEquals(32, key.length); }