-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Bump .NET core framework to 3.1-preview.2 #10993
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| "sdk": { | ||
| "version": "3.1.100-preview1-014459" | ||
| "version": "3.1.100-preview2-014569" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -381,6 +381,15 @@ private static string StreamToString(Stream stream, Encoding encoding) | |
|
|
||
| // Increment byteIndex to the next block of bytes in the input buffer, if any, to convert. | ||
| byteIndex += bytesUsed; | ||
|
|
||
| // The behavior of decoder.Convert changed start .NET 3.1-preview2. | ||
| // The change was made in https://github.com/dotnet/coreclr/pull/27229 | ||
| // The recommendation from .NET team is to not check for 'completed' if 'flush' is false. | ||
| // Break out of the loop if all bytes have been read. | ||
| if (!flush && bytesRead == byteIndex) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now that while (true)
{
// Read at most the number of bytes that will fit in the input buffer. The
// return value is the actual number of bytes read, or zero if no bytes remain.
bytesRead = stream.Read(bytes, 0, useBufferSize * 4);
if (bytesRead == 0)
{
break;
}
bool completed = false;
int byteIndex = 0;
int bytesUsed;
int charsUsed;
while (bytesRead > byteIndex)
{
// If this is the last input data, flush the decoder's internal buffer and state.
bool flush = (bytesRead == 0);
decoder.Convert(bytes, byteIndex, bytesRead - byteIndex,
chars, 0, useBufferSize, flush,
out bytesUsed, out charsUsed, out completed);
// The conversion produced the number of characters indicated by charsUsed. Write that number
// of characters to our result buffer
result.Append(chars, 0, charsUsed);
// Increment byteIndex to the next block of bytes in the input buffer, if any, to convert.
byteIndex += bytesUsed;
}
} while (bytesRead != 0);
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Never mind. Change of the API makes it hard to reason about -- does |
||
| { | ||
| break; | ||
| } | ||
| } | ||
| } while (bytesRead != 0); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.