Support For Getting base-64 String as Byte Array (dotnet/corefx#41467)
* Implemented support for getting Base64 as an equivalent byte array
* New implementation for base-64 support as suggested in review. Added new test cases for it.
* Changed comment
in -> and
Co-Authored-By: Ahson Khan <ahkha@microsoft.com>
* Updated minimum length for TryGetBytesFromBase64 to match minimum length of base-64 string
Co-Authored-By: Günther Foidl <gue@korporal.at>
* Added old Convert.FromBase64String implementation for older platforms. arrayReturnToPool is now cleared before return. Added test cases for edge cases and full branch coverage. Changed magic number to predefined constant.
* Changed catch-all to only catch FormatException. Removed try-finally since it is most likely unnecessary. Now only clears the sliced buffer.
* Changed back to a try-finally solution for readability.
* Using JsonConstants.StackallocThreshold instead of magic number
Co-Authored-By: Ahson Khan <ahkha@microsoft.com>
* Added test to validate TryGetBytesFromBase64(...) gives the corrresulting bytes.
* Allocate to JsonConstants.StackallocThreshold when doing stackalloc
Co-Authored-By: Stephen Toub <stoub@microsoft.com>
Commit migrated from https://github.com/dotnet/corefx/commit/
6a591b2d24869657094816418c46593337550a32