Skip to content

Commit

Permalink
# another method tried to read past EOF
Browse files Browse the repository at this point in the history
  • Loading branch information
Hawkynt committed Dec 15, 2024
1 parent 0693ad0 commit aadc17c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Corlib.Extensions/System/IO/Stream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,7 @@ public static void ReadBytes(this Stream @this, long position, byte[] buffer, Se
/// <returns>A awaitable Task representing the operation</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static Task<int> ReadBytesAsync(this Stream @this, long position, byte[] buffer, SeekOrigin seekOrigin = SeekOrigin.Begin)
=> ReadBytesAsync(@this, position, buffer, 0, buffer.Length, seekOrigin);
=> ReadBytesAsync(@this, position, buffer, 0, (int)Math.Min(buffer.Length, @this.Length - position), seekOrigin);

/// <summary>
/// Reads async Bytes from a given position with a given SeekOrigin in the given buffer with an offset
Expand Down

0 comments on commit aadc17c

Please sign in to comment.