@@ -138,7 +138,7 @@ public override void Flush()
138138 /// <param name="cancellationToken"></param>
139139 public override async Task FlushAsync(CancellationToken cancellationToken)
140140 {
141- await inputStream.FlushAsync(cancellationToken);
141+ await inputStream.FlushAsync(cancellationToken).ConfigureAwait(false) ;
142142 }
143143
144144 /// <summary>
@@ -330,7 +330,7 @@ private async ValueTask<int> ReadAsync(Memory<byte> buffer, CancellationToken ct
330330
331331 while (numToRead > 0)
332332 {
333- await tarBuffer.ReadBlockIntAsync(recBuf, ct, isAsync);
333+ await tarBuffer.ReadBlockIntAsync(recBuf, ct, isAsync).ConfigureAwait(false) ;
334334
335335 var sz = (int)numToRead;
336336
@@ -379,7 +379,7 @@ protected override void Dispose(bool disposing)
379379 /// </summary>
380380 public override async ValueTask DisposeAsync()
381381 {
382- await tarBuffer.CloseAsync(CancellationToken.None);
382+ await tarBuffer.CloseAsync(CancellationToken.None).ConfigureAwait(false) ;
383383 }
384384#endif
385385
@@ -465,7 +465,7 @@ private async ValueTask SkipAsync(long skipCount, CancellationToken ct, bool isA
465465 for (long num = skipCount; num > 0;)
466466 {
467467 int toRead = num > length ? length : (int)num;
468- int numRead = await ReadAsync(skipBuf.Memory.Slice(0, toRead), ct, isAsync);
468+ int numRead = await ReadAsync(skipBuf.Memory.Slice(0, toRead), ct, isAsync).ConfigureAwait(false) ;
469469
470470 if (numRead == -1)
471471 {
@@ -542,18 +542,18 @@ private async ValueTask<TarEntry> GetNextEntryAsync(CancellationToken ct, bool i
542542
543543 if (currentEntry != null)
544544 {
545- await SkipToNextEntryAsync(ct, isAsync);
545+ await SkipToNextEntryAsync(ct, isAsync).ConfigureAwait(false) ;
546546 }
547547
548548 byte[] headerBuf = ArrayPool<byte>.Shared.Rent(TarBuffer.BlockSize);
549- await tarBuffer.ReadBlockIntAsync(headerBuf, ct, isAsync);
549+ await tarBuffer.ReadBlockIntAsync(headerBuf, ct, isAsync).ConfigureAwait(false) ;
550550
551551 if (TarBuffer.IsEndOfArchiveBlock(headerBuf))
552552 {
553553 hasHitEOF = true;
554554
555555 // Read the second zero-filled block
556- await tarBuffer.ReadBlockIntAsync(headerBuf, ct, isAsync);
556+ await tarBuffer.ReadBlockIntAsync(headerBuf, ct, isAsync).ConfigureAwait(false) ;
557557 }
558558 else
559559 {
@@ -592,7 +592,7 @@ private async ValueTask<TarEntry> GetNextEntryAsync(CancellationToken ct, bool i
592592 while (numToRead > 0)
593593 {
594594 var length = (numToRead > TarBuffer.BlockSize ? TarBuffer.BlockSize : (int)numToRead);
595- int numRead = await ReadAsync(nameBuffer.Memory.Slice(0, length), ct, isAsync);
595+ int numRead = await ReadAsync(nameBuffer.Memory.Slice(0, length), ct, isAsync).ConfigureAwait(false) ;
596596
597597 if (numRead == -1)
598598 {
@@ -607,16 +607,16 @@ private async ValueTask<TarEntry> GetNextEntryAsync(CancellationToken ct, bool i
607607 longName = longNameBuilder.ToString();
608608 StringBuilderPool.Instance.Return(longNameBuilder);
609609
610- await SkipToNextEntryAsync(ct, isAsync);
611- await this.tarBuffer.ReadBlockIntAsync(headerBuf, ct, isAsync);
610+ await SkipToNextEntryAsync(ct, isAsync).ConfigureAwait(false) ;
611+ await this.tarBuffer.ReadBlockIntAsync(headerBuf, ct, isAsync).ConfigureAwait(false) ;
612612 }
613613 }
614614 else if (header.TypeFlag == TarHeader.LF_GHDR)
615615 {
616616 // POSIX global extended header
617617 // Ignore things we dont understand completely for now
618- await SkipToNextEntryAsync(ct, isAsync);
619- await this.tarBuffer.ReadBlockIntAsync(headerBuf, ct, isAsync);
618+ await SkipToNextEntryAsync(ct, isAsync).ConfigureAwait(false) ;
619+ await this.tarBuffer.ReadBlockIntAsync(headerBuf, ct, isAsync).ConfigureAwait(false) ;
620620 }
621621 else if (header.TypeFlag == TarHeader.LF_XHDR)
622622 {
@@ -629,7 +629,7 @@ private async ValueTask<TarEntry> GetNextEntryAsync(CancellationToken ct, bool i
629629 while (numToRead > 0)
630630 {
631631 var length = (numToRead > nameBuffer.Length ? nameBuffer.Length : (int)numToRead);
632- int numRead = await ReadAsync(nameBuffer.AsMemory().Slice(0, length), ct, isAsync);
632+ int numRead = await ReadAsync(nameBuffer.AsMemory().Slice(0, length), ct, isAsync).ConfigureAwait(false) ;
633633
634634 if (numRead == -1)
635635 {
@@ -647,14 +647,14 @@ private async ValueTask<TarEntry> GetNextEntryAsync(CancellationToken ct, bool i
647647 longName = name;
648648 }
649649
650- await SkipToNextEntryAsync(ct, isAsync);
651- await this.tarBuffer.ReadBlockIntAsync(headerBuf, ct, isAsync);
650+ await SkipToNextEntryAsync(ct, isAsync).ConfigureAwait(false) ;
651+ await this.tarBuffer.ReadBlockIntAsync(headerBuf, ct, isAsync).ConfigureAwait(false) ;
652652 }
653653 else if (header.TypeFlag == TarHeader.LF_GNU_VOLHDR)
654654 {
655655 // TODO: could show volume name when verbose
656- await SkipToNextEntryAsync(ct, isAsync);
657- await this.tarBuffer.ReadBlockIntAsync(headerBuf, ct, isAsync);
656+ await SkipToNextEntryAsync(ct, isAsync).ConfigureAwait(false) ;
657+ await this.tarBuffer.ReadBlockIntAsync(headerBuf, ct, isAsync).ConfigureAwait(false) ;
658658 }
659659 else if (header.TypeFlag != TarHeader.LF_NORMAL &&
660660 header.TypeFlag != TarHeader.LF_OLDNORM &&
@@ -663,8 +663,8 @@ private async ValueTask<TarEntry> GetNextEntryAsync(CancellationToken ct, bool i
663663 header.TypeFlag != TarHeader.LF_DIR)
664664 {
665665 // Ignore things we dont understand completely for now
666- await SkipToNextEntryAsync(ct, isAsync);
667- await tarBuffer.ReadBlockIntAsync(headerBuf, ct, isAsync);
666+ await SkipToNextEntryAsync(ct, isAsync).ConfigureAwait(false) ;
667+ await tarBuffer.ReadBlockIntAsync(headerBuf, ct, isAsync).ConfigureAwait(false) ;
668668 }
669669
670670 if (entryFactory == null)
@@ -736,15 +736,15 @@ private async ValueTask CopyEntryContentsAsync(Stream outputStream, Cancellation
736736
737737 while (true)
738738 {
739- int numRead = await ReadAsync(tempBuffer, ct, isAsync);
739+ int numRead = await ReadAsync(tempBuffer, ct, isAsync).ConfigureAwait(false) ;
740740 if (numRead <= 0)
741741 {
742742 break;
743743 }
744744
745745 if (isAsync)
746746 {
747- await outputStream.WriteAsync(tempBuffer, 0, numRead, ct);
747+ await outputStream.WriteAsync(tempBuffer, 0, numRead, ct).ConfigureAwait(false) ;
748748 }
749749 else
750750 {
@@ -761,7 +761,7 @@ private async ValueTask SkipToNextEntryAsync(CancellationToken ct, bool isAsync)
761761
762762 if (numToSkip > 0)
763763 {
764- await SkipAsync(numToSkip, ct, isAsync);
764+ await SkipAsync(numToSkip, ct, isAsync).ConfigureAwait(false) ;
765765 }
766766
767767 readBuffer?.Dispose();
0 commit comments