Skip to content

Commit c4009fd

Browse files
authored
fix(tar): enable async overrides on net6 (#811)
1 parent 58b5c4e commit c4009fd

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/ICSharpCode.SharpZipLib/Tar/TarBuffer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ private async ValueTask CloseAsync(CancellationToken ct, bool isAsync)
640640
{
641641
if (isAsync)
642642
{
643-
#if NETSTANDARD2_1_OR_GREATER
643+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
644644
await outputStream.DisposeAsync().ConfigureAwait(false);
645645
#else
646646
outputStream.Dispose();
@@ -660,7 +660,7 @@ private async ValueTask CloseAsync(CancellationToken ct, bool isAsync)
660660
{
661661
if (isAsync)
662662
{
663-
#if NETSTANDARD2_1_OR_GREATER
663+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
664664
await inputStream.DisposeAsync().ConfigureAwait(false);
665665
#else
666666
inputStream.Dispose();

src/ICSharpCode.SharpZipLib/Tar/TarHeader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ public static string ParseName(ReadOnlySpan<byte> header, Encoding encoding)
869869
}
870870
}
871871

872-
#if NETSTANDARD2_1_OR_GREATER
872+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
873873
var value = encoding.GetString(header.Slice(0, count));
874874
#else
875875
var value = encoding.GetString(header.ToArray(), 0, count);

src/ICSharpCode.SharpZipLib/Tar/TarInputStream.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public override Task<int> ReadAsync(byte[] buffer, int offset, int count, Cancel
232232
return ReadAsync(buffer.AsMemory().Slice(offset, count), cancellationToken, true).AsTask();
233233
}
234234

235-
#if NETSTANDARD2_1_OR_GREATER
235+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
236236
/// <summary>
237237
/// Reads bytes from the current tar archive entry.
238238
///
@@ -372,7 +372,7 @@ protected override void Dispose(bool disposing)
372372
}
373373
}
374374

375-
#if NETSTANDARD2_1_OR_GREATER
375+
#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_1_OR_GREATER
376376
/// <summary>
377377
/// Closes this stream. Calls the TarBuffer's close() method.
378378
/// The underlying stream is closed by the TarBuffer.

0 commit comments

Comments
 (0)