@Test public void testGetArrayPastEOF() throws Exception{ PagedChannelRandomAccessSource s = new PagedChannelRandomAccessSource(channel); try{ byte[] chunk = new byte[(int)channel.size() * 2]; int len = s.get(0, chunk, 0, chunk.length); Assert.assertEquals((int)channel.size(), len); } finally { s.close(); } }
@Override public void close() throws IOException { super.close(); channel.close(); }
PagedChannelRandomAccessSource extends GroupedRandomAccessSource implements RandomAccessSource { @Override public void close() throws IOException { super.close(); channel.close(); } }
PagedChannelRandomAccessSource extends GroupedRandomAccessSource implements RandomAccessSource { @Override public void close() throws IOException { super.close(); channel.close(); } PagedChannelRandomAccessSource(FileChannel channel);  PagedChannelRandomAccessSource(final FileChannel channel, final int totalBufferSize, final int maxOpenBuffers); }
PagedChannelRandomAccessSource extends GroupedRandomAccessSource implements RandomAccessSource { @Override public void close() throws IOException { super.close(); channel.close(); } PagedChannelRandomAccessSource(FileChannel channel);  PagedChannelRandomAccessSource(final FileChannel channel, final int totalBufferSize, final int maxOpenBuffers); @Override /** * {@inheritDoc} * Cleans the mapped bytebuffers and closes the channel */ void close(); }
PagedChannelRandomAccessSource extends GroupedRandomAccessSource implements RandomAccessSource { @Override public void close() throws IOException { super.close(); channel.close(); } PagedChannelRandomAccessSource(FileChannel channel);  PagedChannelRandomAccessSource(final FileChannel channel, final int totalBufferSize, final int maxOpenBuffers); @Override /** * {@inheritDoc} * Cleans the mapped bytebuffers and closes the channel */ void close(); static final int DEFAULT_TOTAL_BUFSIZE; static final int DEFAULT_MAX_OPEN_BUFFERS; }