public Task SendFileAsync(string path, long offset, long?count, CancellationToken cancellation) { OnWrite(); if (_compressionStream != null) { return(SendFileFallback.SendFileAsync(Stream, path, offset, count, cancellation)); } return(_innerBodyFeature.SendFileAsync(path, offset, count, cancellation)); }
public Task SendFileAsync(string path, long offset, long?count, CancellationToken cancellationToken) { Initialize(); if (_minificationEnabled || _compressionEnabled) { return(SendFileFallback.SendFileAsync(Stream, path, offset, count, cancellationToken)); } return(_responseBodyFeature.SendFileAsync(path, offset, count, cancellationToken)); }
public async Task SendFileAsync(string path, long offset, long?count, CancellationToken cancellationToken = default) { await inner.SendFileAsync(path, offset, count, cancellationToken); if (count != null) { bytesWritten += count.Value; } else { var file = new FileInfo(path); if (file.Exists) { bytesWritten += file.Length; } } }
public Task SendFileAsync(string path, long offset, long?count, CancellationToken cancellationToken = default) { _captureStream.CaptureStream.Write(File.ReadAllBytes(path)); return(_responseBodyFeature.SendFileAsync(path, offset, count, cancellationToken)); }
public Task SendFileAsync(string path, long offset, long?count, CancellationToken cancellationToken = default) { return(_innerResponseBodyFeature.SendFileAsync(path, offset, count, cancellationToken)); }