using System.Text;
using Beam.Abstractions;
using Microsoft.Extensions.Logging;

namespace Beam.Stealth.Strategies;

internal class PageDownloadStrategy : IDownloadStrategy {
    public async Task DownloadToStream(string url, int bufferSize, Stream destinationStream, IProgress<IDownloadReport> progress, StealthConfig config,
        ILogger? logger, CancellationToken ct) {
        byte[] bytes = Encoding.UTF8.GetBytes(config.Driver.PageSource);
        await destinationStream.WriteAsync(bytes, ct);
    }
}