Add Skip and TrySkip APIs to Utf8JsonReader with tests. (dotnet/corefx#37793)
authorAhson Khan <ahkha@microsoft.com>
Tue, 28 May 2019 19:26:08 +0000 (12:26 -0700)
committerGitHub <noreply@github.com>
Tue, 28 May 2019 19:26:08 +0000 (12:26 -0700)
commit17c9d54f25139a5dd2d61e835ec2a93389ef4f73
tree8fa351bcbb21ab08ebe24c88f693fa69fc182fe3
parentdbb09e4ab936413694faa3f743c8d8f6cd8e5aba
Add Skip and TrySkip APIs to Utf8JsonReader with tests. (dotnet/corefx#37793)

* Add Skip and TrySkip APIs to Utf8JsonReader with tests.

* Auto-generate the ref assembly.

* Remove new lines and update bytes consumed to avoid adjusting OS specific offsets.

* Add IsFinalBlock public property.

* Break up the skip/try skip method into helpers.

* Add more direct tests and update impl to avoid unnecessary struct copy.

Commit migrated from https://github.com/dotnet/corefx/commit/2f2aca43ef9d24c794255c3ef5d0238dc479652b
src/libraries/System.Text.Json/ref/System.Text.Json.cs
src/libraries/System.Text.Json/src/Resources/Strings.resx
src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.cs
src/libraries/System.Text.Json/src/System/Text/Json/ThrowHelper.cs
src/libraries/System.Text.Json/tests/JsonTestHelper.cs
src/libraries/System.Text.Json/tests/Utf8JsonReaderTests.MultiSegment.cs
src/libraries/System.Text.Json/tests/Utf8JsonReaderTests.cs