diff --git a/MetadataExtractor/IO/IndexedSeekingReader.cs b/MetadataExtractor/IO/IndexedSeekingReader.cs index ae27d06f9..153c69d2e 100644 --- a/MetadataExtractor/IO/IndexedSeekingReader.cs +++ b/MetadataExtractor/IO/IndexedSeekingReader.cs @@ -41,7 +41,7 @@ public IndexedSeekingReader(Stream stream, int baseOffset = 0, bool isMotorolaBy public override long Length { get; } -#if !NETSTANDARD2_1 +#if !NETSTANDARD2_1 && !NET8_0_OR_GREATER private readonly byte[] _buffer = new byte[2048]; #endif @@ -59,7 +59,7 @@ public override void GetBytes(int index, Span bytes) while (totalBytesRead != bytes.Length) { var target = bytes.Slice(totalBytesRead); -#if NETSTANDARD2_1 +#if NETSTANDARD2_1 || NET8_0_OR_GREATER var bytesRead = _stream.Read(target); #else var len = Math.Min(bytes.Length - totalBytesRead, _buffer.Length); @@ -75,7 +75,6 @@ public override void GetBytes(int index, Span bytes) Debug.Assert(totalBytesRead <= bytes.Length); } - } private void Seek(int index) diff --git a/MetadataExtractor/IO/SequentialStreamReader.cs b/MetadataExtractor/IO/SequentialStreamReader.cs index 9dc5f995e..4fdd1af8e 100644 --- a/MetadataExtractor/IO/SequentialStreamReader.cs +++ b/MetadataExtractor/IO/SequentialStreamReader.cs @@ -51,7 +51,7 @@ public override void GetBytes(byte[] buffer, int offset, int count) } } -#if !NETSTANDARD2_1 +#if !NETSTANDARD2_1 && !NET8_0_OR_GREATER private readonly byte[] _buffer = new byte[2048]; #endif @@ -62,7 +62,7 @@ public override void GetBytes(Span bytes) while (totalBytesRead != bytes.Length) { var target = bytes.Slice(totalBytesRead); -#if NETSTANDARD2_1 +#if NETSTANDARD2_1 || NET8_0_OR_GREATER var bytesRead = _stream.Read(target); #else var len = Math.Min(bytes.Length - totalBytesRead, _buffer.Length);