BililiveRecorder/BililiveRecorder.FlvProcessor/Utils.cs

23 lines
510 B
C#
Raw Normal View History

2018-03-19 01:05:02 +08:00
using System;
using System.Linq;
namespace BililiveRecorder.FlvProcessor
{
internal static class Utils
{
2018-03-24 02:27:58 +08:00
/// <summary>
/// 转换字节序。实际上通常是把 BE 转成 LE
/// </summary>
/// <param name="b"></param>
/// <returns></returns>
2018-03-19 01:05:02 +08:00
internal static byte[] ToBE(this byte[] b)
{
if (BitConverter.IsLittleEndian)
return b.Reverse().ToArray();
else
return b;
}
}
}