mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-09-25 00:15:15 +00:00
Minor changes
This commit is contained in:
@@ -20,7 +20,8 @@ namespace SharpCompress.Writers
|
||||
{
|
||||
throw new ArgumentException("Source does not exist: " + source.FullName);
|
||||
}
|
||||
using (var stream = source.OpenRead())
|
||||
|
||||
await using (var stream = source.OpenRead())
|
||||
{
|
||||
await writer.WriteAsync(entryPath, stream, source.LastWriteTime, cancellationToken);
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace SharpCompress.Writers.Zip
|
||||
public async ValueTask WriteAsync(string entryPath, Stream source, ZipWriterEntryOptions zipWriterEntryOptions, CancellationToken cancellationToken = default)
|
||||
{
|
||||
await using Stream output = await WriteToStreamAsync(entryPath, zipWriterEntryOptions, cancellationToken);
|
||||
await source.TransferToAsync(output, cancellationToken);
|
||||
await source.CopyToAsync(output, cancellationToken);
|
||||
}
|
||||
|
||||
public async ValueTask<Stream> WriteToStreamAsync(string entryPath, ZipWriterEntryOptions options, CancellationToken cancellationToken = default)
|
||||
|
||||
Reference in New Issue
Block a user