Copy Aetheria Code

Added a bunch of code from the old Aetheria project
This commit is contained in:
hyperion51 2020-02-27 18:51:07 +00:00
commit c58ba0b1da
1704 changed files with 175081 additions and 313 deletions

View file

@ -1,31 +0,0 @@
// Copyright (c) All contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
namespace MessagePack
{
internal static class StringEncoding
{
internal static readonly Encoding UTF8 = new UTF8Encoding(false);
#if !NETCOREAPP2_1 // Define the extension method only where an instance method does not already exist.
internal static unsafe string GetString(this Encoding encoding, ReadOnlySpan<byte> bytes)
{
if (bytes.Length == 0)
{
return string.Empty;
}
fixed (byte* pBytes = bytes)
{
return encoding.GetString(pBytes, bytes.Length);
}
}
#endif
}
}