<PackageReference Include="System.Buffers" Version="4.6.0" />

SR

static class SR
using FxResources.System.Buffers; using System.Resources; using System.Runtime.CompilerServices; namespace System { [System.Runtime.CompilerServices.NullableContext(1)] [System.Runtime.CompilerServices.Nullable(0)] internal static class SR { private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out bool isEnabled) && isEnabled; [System.Runtime.CompilerServices.Nullable(0)] private static ResourceManager s_resourceManager; [System.Runtime.CompilerServices.Nullable(0)] internal static ResourceManager ResourceManager { [System.Runtime.CompilerServices.NullableContext(0)] get { return s_resourceManager ?? (s_resourceManager = new ResourceManager(typeof(FxResources.System.Buffers.SR))); } } [System.Runtime.CompilerServices.Nullable(0)] internal static string ArgumentException_BufferNotFromPool { [System.Runtime.CompilerServices.NullableContext(0)] get { return GetResourceString("ArgumentException_BufferNotFromPool"); } } private static bool UsingResourceKeys() { return s_usingResourceKeys; } internal static string GetResourceString(string resourceKey) { if (!UsingResourceKeys()) { string result = null; try { result = ResourceManager.GetString(resourceKey); return result; } catch (MissingManifestResourceException) { return result; } } return resourceKey; } internal static string GetResourceString(string resourceKey, string defaultString) { string resourceString = GetResourceString(resourceKey); if (!(resourceKey == resourceString) && resourceString != null) return resourceString; return defaultString; } internal static string Format(string resourceFormat, [System.Runtime.CompilerServices.Nullable(2)] object p1) { if (UsingResourceKeys()) return string.Join(", ", resourceFormat, p1); return string.Format(resourceFormat, p1); } internal static string Format(string resourceFormat, [System.Runtime.CompilerServices.Nullable(2)] object p1, [System.Runtime.CompilerServices.Nullable(2)] object p2) { if (UsingResourceKeys()) return string.Join(", ", resourceFormat, p1, p2); return string.Format(resourceFormat, p1, p2); } [System.Runtime.CompilerServices.NullableContext(2)] [return: System.Runtime.CompilerServices.Nullable(1)] internal static string Format([System.Runtime.CompilerServices.Nullable(1)] string resourceFormat, object p1, object p2, object p3) { if (UsingResourceKeys()) return string.Join(", ", resourceFormat, p1, p2, p3); return string.Format(resourceFormat, p1, p2, p3); } internal static string Format(string resourceFormat, [System.Runtime.CompilerServices.Nullable(2)] params object[] args) { if (args != null) { if (UsingResourceKeys()) return resourceFormat + ", " + string.Join(", ", args); return string.Format(resourceFormat, args); } return resourceFormat; } internal static string Format([System.Runtime.CompilerServices.Nullable(2)] IFormatProvider provider, string resourceFormat, [System.Runtime.CompilerServices.Nullable(2)] object p1) { if (UsingResourceKeys()) return string.Join(", ", resourceFormat, p1); return string.Format(provider, resourceFormat, p1); } [System.Runtime.CompilerServices.NullableContext(2)] [return: System.Runtime.CompilerServices.Nullable(1)] internal static string Format(IFormatProvider provider, [System.Runtime.CompilerServices.Nullable(1)] string resourceFormat, object p1, object p2) { if (UsingResourceKeys()) return string.Join(", ", resourceFormat, p1, p2); return string.Format(provider, resourceFormat, p1, p2); } [System.Runtime.CompilerServices.NullableContext(2)] [return: System.Runtime.CompilerServices.Nullable(1)] internal static string Format(IFormatProvider provider, [System.Runtime.CompilerServices.Nullable(1)] string resourceFormat, object p1, object p2, object p3) { if (UsingResourceKeys()) return string.Join(", ", resourceFormat, p1, p2, p3); return string.Format(provider, resourceFormat, p1, p2, p3); } internal static string Format([System.Runtime.CompilerServices.Nullable(2)] IFormatProvider provider, string resourceFormat, [System.Runtime.CompilerServices.Nullable(2)] params object[] args) { if (args != null) { if (UsingResourceKeys()) return resourceFormat + ", " + string.Join(", ", args); return string.Format(provider, resourceFormat, args); } return resourceFormat; } } }