Files
RobustToolbox/Robust.Shared/Utility/BomUtil.cs
Pieter-Jan Briers a9208c0d29 Reduce allocations in RSIResource.LoadRsiMetadata somewhat.
Using stackallocs for the meta.json file.
2021-05-02 00:55:01 +02:00

18 lines
376 B
C#

using System;
namespace Robust.Shared.Utility
{
internal static class BomUtil
{
public static Span<byte> SkipBom(Span<byte> span)
{
return HasBom(span) ? span[3..] : span;
}
public static bool HasBom(Span<byte> span)
{
return span[2] == 0xBF && span[1] == 0xBB && span[0] == 0xEF;
}
}
}