/** * Constructs a new {@link PagedChannelRandomAccessSource} based on the specified FileChannel, with a specific buffer size * @param channel the channel to use as the backing store * @param totalBufferSize total buffer size * @param maxOpenBuffers open buffers * @throws java.io.IOException if the channel cannot be opened or mapped */ public PagedChannelRandomAccessSource(FileChannel channel, int totalBufferSize, int maxOpenBuffers) throws java.io.IOException { super(buildSources(channel, totalBufferSize/maxOpenBuffers)); this.channel = channel; this.bufferSize = totalBufferSize/maxOpenBuffers; this.mru = new MRU<IRandomAccessSource>(maxOpenBuffers); }
/** * Constructs a new {@link PagedChannelRandomAccessSource} based on the specified FileChannel, with a specific buffer size * @param channel the channel to use as the backing store * @param totalBufferSize total buffer size * @param maxOpenBuffers open buffers * @throws java.io.IOException if the channel cannot be opened or mapped */ public PagedChannelRandomAccessSource(FileChannel channel, int totalBufferSize, int maxOpenBuffers) throws java.io.IOException { super(buildSources(channel, totalBufferSize/maxOpenBuffers)); this.channel = channel; this.bufferSize = totalBufferSize/maxOpenBuffers; this.mru = new MRU<IRandomAccessSource>(maxOpenBuffers); }