Innovenergy_trunk/csharp/App/Collector/src/Utils/Utils.cs

19 lines
506 B
C#

namespace InnovEnergy.App.Collector.Utils;
public static class Utils
{
public static readonly DateTime Epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
public static IEnumerable<ArraySegment<Byte>> ParseLengthValueEncoded(this Byte[] source)
{
var index = 0;
while (index < source.Length)
{
var length = source[index++];
yield return new ArraySegment<Byte>(source, index, length);
index += length;
}
}
}