/** * {@inheritDoc} * Ensure that the source is mapped. In the future, we may implement an MRU that allows multiple pages to be opened at a time */ @Override protected void sourceInUse(IRandomAccessSource source) throws java.io.IOException { ((MappedChannelRandomAccessSource)source).open(); }
/** * {@inheritDoc} * Ensure that the source is mapped. In the future, we may implement an MRU that allows multiple pages to be opened at a time */ @Override protected void sourceInUse(IRandomAccessSource source) throws java.io.IOException { ((MappedChannelRandomAccessSource)source).open(); }
/** * Constructs a new {@link FileChannelRandomAccessSource} based on the specified FileChannel. The entire source channel will be mapped into memory. * @param channel the channel to use as the backing store * @throws java.io.IOException if the channel cannot be opened or mapped */ public FileChannelRandomAccessSource(FileChannel channel) throws java.io.IOException { this.channel = channel; if(channel.size() == 0) throw new java.io.IOException("File size is 0 bytes"); source = new MappedChannelRandomAccessSource(channel, 0, channel.size()); source.open(); }
/** * Constructs a new {@link FileChannelRandomAccessSource} based on the specified FileChannel. The entire source channel will be mapped into memory. * @param channel the channel to use as the backing store * @throws java.io.IOException if the channel cannot be opened or mapped */ public FileChannelRandomAccessSource(FileChannel channel) throws java.io.IOException { this.channel = channel; if(channel.size() == 0) throw new java.io.IOException("File size is 0 bytes"); source = new MappedChannelRandomAccessSource(channel, 0, channel.size()); source.open(); }