@Test public void close() throws Exception { mReader.close(); mThrown.expect(IOException.class); mReader.read(0, TEST_BLOCK_SIZE); }
@Override public void close() throws IOException { super.close(); Preconditions.checkState(mUsageCount == 0); if (mClosed) { return; } try { mCloser.close(); } finally { mClosed = true; } }
LocalFileBlockReader extends BlockReader { @Override public void close() throws IOException { super.close(); Preconditions.checkState(mUsageCount == 0); if (mClosed) { return; } try { mCloser.close(); } finally { mClosed = true; } } }
LocalFileBlockReader extends BlockReader { @Override public void close() throws IOException { super.close(); Preconditions.checkState(mUsageCount == 0); if (mClosed) { return; } try { mCloser.close(); } finally { mClosed = true; } } LocalFileBlockReader(String path); }
LocalFileBlockReader extends BlockReader { @Override public void close() throws IOException { super.close(); Preconditions.checkState(mUsageCount == 0); if (mClosed) { return; } try { mCloser.close(); } finally { mClosed = true; } } LocalFileBlockReader(String path); @Override ReadableByteChannel getChannel(); @Override long getLength(); void increaseUsageCount(); void decreaseUsageCount(); int getUsageCount(); String getFilePath(); @Override ByteBuffer read(long offset, long length); @Override int transferTo(ByteBuf buf); @Override void close(); @Override boolean isClosed(); }
LocalFileBlockReader extends BlockReader { @Override public void close() throws IOException { super.close(); Preconditions.checkState(mUsageCount == 0); if (mClosed) { return; } try { mCloser.close(); } finally { mClosed = true; } } LocalFileBlockReader(String path); @Override ReadableByteChannel getChannel(); @Override long getLength(); void increaseUsageCount(); void decreaseUsageCount(); int getUsageCount(); String getFilePath(); @Override ByteBuffer read(long offset, long length); @Override int transferTo(ByteBuf buf); @Override void close(); @Override boolean isClosed();  }