Example #1
0
 /// <inheritdoc cref="FileListEntryStream" />
 /// <summary>
 ///     Initializes a new instance of the <see cref="RemoteFileListEntryStream" /> class.
 /// </summary>
 /// <param name="javascriptRuntime">The JavaScript runtime.</param>
 /// <param name="inputFileElement">The input file reference.</param>
 /// <param name="file">The <see cref="FileListEntry" />.</param>
 /// <param name="maximumMessageSize">The maximum message size.</param>
 /// <param name="maxBufferSize">The maximum buffer size.</param>
 /// <seealso cref="FileListEntryStream" />
 public RemoteFileListEntryStream(IJSRuntime javascriptRuntime, ElementReference inputFileElement, FileListEntry file, int maximumMessageSize, int maxBufferSize)
     : base(javascriptRuntime, inputFileElement, file)
 {
     this.maximumMessageSize         = maximumMessageSize;
     this.blockSequence              = new PreFetchingSequence <Block>(this.FetchBase64Block, (file.Size + this.maximumMessageSize - 1) / this.maximumMessageSize, Math.Max(1, maxBufferSize / this.maximumMessageSize)); // Degree of parallelism on fetch
     this.currentBlockDecodingBuffer = new byte[this.maximumMessageSize];
 }
 public RemoteFileListEntryStream(IJSRuntime jsRuntime, ElementReference inputFileElement, FileListEntryImpl file, int maxMessageSize, int maxBufferSize)
     : base(jsRuntime, inputFileElement, file)
 {
     _maxMessageSize = maxMessageSize;
     _blockSequence  = new PreFetchingSequence <Block>(
         FetchBase64Block,
         (file.Size + _maxMessageSize - 1) / _maxMessageSize,
         Math.Max(1, maxBufferSize / _maxMessageSize)); // Degree of parallelism on fetch
     _currentBlockDecodingBuffer = new byte[_maxMessageSize];
 }