@Test(expected = BlockStoreException.class) public void twoStores_sequentially_shrink() throws Exception { SPVBlockStore store = new SPVBlockStore(UNITTEST, blockStoreFile, 20, true); store.close(); store = new SPVBlockStore(UNITTEST, blockStoreFile, 10, true); }
@Override public void close() throws BlockStoreException { try { buffer.force(); buffer = null; fileLock.release(); randomAccessFile.close(); blockCache.clear(); } catch (IOException e) { throw new BlockStoreException(e); } }
SPVBlockStore implements BlockStore { @Override public void close() throws BlockStoreException { try { buffer.force(); buffer = null; fileLock.release(); randomAccessFile.close(); blockCache.clear(); } catch (IOException e) { throw new BlockStoreException(e); } } }
SPVBlockStore implements BlockStore { @Override public void close() throws BlockStoreException { try { buffer.force(); buffer = null; fileLock.release(); randomAccessFile.close(); blockCache.clear(); } catch (IOException e) { throw new BlockStoreException(e); } } SPVBlockStore(NetworkParameters params, File file);  SPVBlockStore(NetworkParameters params, File file, int capacity, boolean grow); }
SPVBlockStore implements BlockStore { @Override public void close() throws BlockStoreException { try { buffer.force(); buffer = null; fileLock.release(); randomAccessFile.close(); blockCache.clear(); } catch (IOException e) { throw new BlockStoreException(e); } } SPVBlockStore(NetworkParameters params, File file);  SPVBlockStore(NetworkParameters params, File file, int capacity, boolean grow); static final int getFileSize(int capacity); @Override void put(StoredBlock block); @Override @Nullable StoredBlock get(Sha256Hash hash); @Override StoredBlock getChainHead(); @Override void setChainHead(StoredBlock chainHead); @Override void close(); @Override NetworkParameters getParams(); void clear(); }
SPVBlockStore implements BlockStore { @Override public void close() throws BlockStoreException { try { buffer.force(); buffer = null; fileLock.release(); randomAccessFile.close(); blockCache.clear(); } catch (IOException e) { throw new BlockStoreException(e); } } SPVBlockStore(NetworkParameters params, File file);  SPVBlockStore(NetworkParameters params, File file, int capacity, boolean grow); static final int getFileSize(int capacity); @Override void put(StoredBlock block); @Override @Nullable StoredBlock get(Sha256Hash hash); @Override StoredBlock getChainHead(); @Override void setChainHead(StoredBlock chainHead); @Override void close(); @Override NetworkParameters getParams(); void clear(); static final int DEFAULT_CAPACITY; static final String HEADER_MAGIC; }