DomDatabaseWrapper extends AbstractDatabase<DomDatabaseWrapper, DomGroupWrapper, DomEntryWrapper, DomIconWrapper> { @Override public void save(Credentials credentials, OutputStream outputStream) throws IOException { new KdbxStreamFormat().save(domDatabase, credentials, outputStream); setDirty(false); } DomDatabaseWrapper();  DomDatabaseWrapper(StreamFormat streamFormat, Credentials credentials, InputStream inputStream); static DomDatabaseWrapper load(Credentials credentials, InputStream inputStream); @Override void save(Credentials credentials, OutputStream outputStream); void save(StreamFormat streamFormat, Credentials credentials, OutputStream outputStream); boolean shouldProtect(String name); @Override DomGroupWrapper getRootGroup(); @Override DomGroupWrapper newGroup(); @Override DomEntryWrapper newEntry(); @Override DomIconWrapper newIcon(); @Override DomIconWrapper newIcon(Integer i); @Override DomGroupWrapper getRecycleBin(); @Override boolean isRecycleBinEnabled(); @Override void enableRecycleBin(boolean enable); String getName(); void setName(String name); @Override String getDescription(); @Override void setDescription(String description);  }
@Test public void inspectPasswordDatabase() throws IOException { InputStream inputStream = getClass().getClassLoader().getResourceAsStream("test123.kdbx"); DomDatabaseWrapper database = new DomDatabaseWrapper(new KdbxStreamFormat(), new KdbxCreds("123".getBytes()), inputStream); database.save(new StreamFormat.None(), new Credentials.None(), System.out); }
@Test public void inspectKeyfileDatabase() throws IOException { InputStream keyFileInputStream = getClass().getClassLoader().getResourceAsStream("KeyFileDatabase.key"); Credentials credentials = new KdbxCreds("123".getBytes(), keyFileInputStream); InputStream inputStream = getClass().getClassLoader().getResourceAsStream("KeyFileDatabase.kdbx"); DomDatabaseWrapper database = new DomDatabaseWrapper(new KdbxStreamFormat(), credentials, inputStream); database.save(new StreamFormat.None(), new Credentials.None(), System.out); }