-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Address .NET 5-specific suggestions for System.Net.Http.Json #34355
Conversation
|
||
namespace System.Net.Http.Json | ||
{ | ||
internal sealed partial class TranscodingReadStream : Stream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't need a private implementation for .NET 5; you should contribute this as part of #30260
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GrabYourPitchforks are you actively working on that issue, it is marked for 5.0, is that still the plan?
I want to assume that these TranscodingStream
s aren't going to be the fix that closes above issue.
In that case, I think it makes more sense if I close this PR and wait for 30260 to close.
if (buffer == null) | ||
{ | ||
throw new ArgumentNullException(nameof(buffer)); | ||
} | ||
|
||
if (offset < 0) | ||
{ | ||
throw new ArgumentOutOfRangeException(nameof(offset)); | ||
} | ||
|
||
if (count < 0) | ||
{ | ||
throw new ArgumentOutOfRangeException(nameof(count)); | ||
} | ||
|
||
if (buffer.Length - offset < count) | ||
{ | ||
throw new ArgumentException(SR.Argument_InvalidOffLen); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Memory
ctor performs these checks; shouldn't need them here unless parameter names are different.
Follow-up to #33459
TranscodingRead/WriteStream
for netcoreapp.TranscodingWriteStream
in order to prepare the road for the new sync HttpClient APIs (Sync API for HttpClient #32125).