iTextSharp.text.io.RandomAccessSourceFactory.CreateRanged C# (CSharp) Метод

CreateRanged() публичный Метод

public CreateRanged ( IRandomAccessSource source, IList ranges ) : IRandomAccessSource
source IRandomAccessSource
ranges IList
Результат IRandomAccessSource
        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);
        }
        

Usage Example

Пример #1
0
 /**
  * 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));
 }