/** * Constructs a new {@link GroupedRandomAccessSource} based on the specified set of sources * @param sources the sources used to build this group */ public GroupedRandomAccessSource(IRandomAccessSource[] sources) throws java.io.IOException { this.sources = new SourceEntry[sources.length]; long totalSize = 0; for(int i = 0; i < sources.length; i++){ this.sources[i] = new SourceEntry(i, sources[i], totalSize); totalSize += sources[i].length(); } size = totalSize; currentSourceEntry = this.sources[sources.length-1]; sourceInUse(currentSourceEntry.source); }
/** * Constructs a new {@link GroupedRandomAccessSource} based on the specified set of sources * @param sources the sources used to build this group */ public GroupedRandomAccessSource(IRandomAccessSource[] sources) throws java.io.IOException { this.sources = new SourceEntry[sources.length]; long totalSize = 0; for(int i = 0; i < sources.length; i++){ this.sources[i] = new SourceEntry(i, sources[i], totalSize); totalSize += sources[i].length(); } size = totalSize; currentSourceEntry = this.sources[sources.length-1]; sourceInUse(currentSourceEntry.source); }