public IRandomAccessSource CreateRanged(IRandomAccessSource source, IList<long> ranges) { IRandomAccessSource[] sources = new IRandomAccessSource[ranges.Count/2]; for(int i = 0; i < ranges.Count; i+=2){ sources[i/2] = new WindowRandomAccessSource(source, ranges[i], ranges[i+1]); } return new GroupedRandomAccessSource(sources); }
/** * Gets the document bytes that are hashable when using external signatures. The general sequence is: * preClose(), getRangeStream() and close(). * <p> * @return the document bytes that are hashable */ public Stream GetRangeStream() { RandomAccessSourceFactory fac = new RandomAccessSourceFactory(); return new RASInputStream(fac.CreateRanged(GetUnderlyingSource(), range)); }