Skip to content

Commit 1c2961f

Browse files
committed
fix async for net45
1 parent a888745 commit 1c2961f

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/ICSharpCode.SharpZipLib/GZip/GzipOutputStream.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,7 @@ public override void Finish()
244244
{
245245
state_ = OutputState.Finished;
246246
base.Finish();
247-
248-
byte[] gzipFooter = GetFooter();
249-
247+
var gzipFooter = GetFooter();
250248
baseOutputStream_.Write(gzipFooter, 0, gzipFooter.Length);
251249
}
252250
}
@@ -272,7 +270,8 @@ public override async Task FinishAsync(CancellationToken ct)
272270
{
273271
state_ = OutputState.Finished;
274272
await base.FinishAsync(ct);
275-
await baseOutputStream_.WriteAsync(GetFooter(), ct);
273+
var gzipFooter = GetFooter();
274+
await baseOutputStream_.WriteAsync(gzipFooter, 0, gzipFooter.Length, ct);
276275
}
277276
}
278277

@@ -352,7 +351,7 @@ private void WriteHeader()
352351
baseOutputStream_.Write(gzipHeader, 0, gzipHeader.Length);
353352
}
354353

355-
private async ValueTask WriteHeaderAsync()
354+
private async Task WriteHeaderAsync()
356355
{
357356
if (state_ != OutputState.Header) return;
358357
state_ = OutputState.Footer;

0 commit comments

Comments
 (0)