/** * @param cache optional * @param crypto optional * @param in snapshot source; does not require extra buffering; auto-closed */ static PageDb restoreFromSnapshot(PageArray pa, PageCache cache, Crypto crypto, InputStream in) throws IOException { if (!pa.isEmpty()) { throw new DatabaseException("Cannot restore into a non-empty file"); } byte[] buffer = new byte[pa.pageSize()]; /*P*/ byte[] bufferPage = p_transfer(buffer); return restoreFromSnapshot(cache, crypto, in, buffer, bufferPage, pa, 0); }
/** * @param cache optional * @param crypto optional * @param in snapshot source; does not require extra buffering; auto-closed */ static PageDb restoreFromSnapshot(PageArray pa, PageCache cache, Crypto crypto, InputStream in) throws IOException { if (!pa.isEmpty()) { throw new DatabaseException("Cannot restore into a non-empty file"); } byte[] buffer = new byte[pa.pageSize()]; /*P*/ byte[] bufferPage = p_transfer(buffer); return restoreFromSnapshot(cache, crypto, in, buffer, bufferPage, pa, 0); }
restored = DurablePageDb.restoreFromSnapshot(dataPageArray, null, config.mCrypto, in); } else { for (File f : dataFiles) { restored = DurablePageDb.restoreFromSnapshot (pageSize, dataFiles, factory, options, null, config.mCrypto, in);
restored = DurablePageDb.restoreFromSnapshot(dataPageArray, null, config.mCrypto, in); } else { for (File f : dataFiles) { restored = DurablePageDb.restoreFromSnapshot (pageSize, dataFiles, factory, options, null, config.mCrypto, in);
restored = DurablePageDb.restoreFromSnapshot(dataPageArray, null, config.mCrypto, in); } else { if (!config.mReadOnly) { restored = DurablePageDb.restoreFromSnapshot (pageSize, dataFiles, factory, options, null, config.mCrypto, in);
return restoreFromSnapshot(cache, crypto, in, buffer, pa); } finally { closeQuietly(in);
return restoreFromSnapshot(cache, crypto, in, buffer, bufferPage, pa, index);
return restoreFromSnapshot(cache, crypto, in, buffer, bufferPage, pa, index);
return restoreFromSnapshot(cache, crypto, in, buffer, pa); } finally { closeQuietly(in);