Ejemplo n.º 1
0
        // ReSharper disable once MemberCanBePrivate.Global
        public static T ReadEvent <T>(IBinaryReader reader, IHerculesEventBuilder <T> builder)
        {
            reader.EnsureBigEndian();

            var version = reader.ReadByte();

            if (version != Constants.EventProtocolVersion)
            {
                throw new NotSupportedException($"Unsupported Hercules protocol version: {version}");
            }

            var utcTimestamp = EpochHelper.FromUnixTimeUtcTicks(reader.ReadInt64());

            builder.SetTimestamp(new DateTimeOffset(utcTimestamp, TimeSpan.Zero));

            reader.Position += 16;
            ReadContainer(reader, builder);

            return(builder.BuildEvent());
        }
Ejemplo n.º 2
0
 public static StreamCoordinates Read(IBinaryReader reader)
 {
     return(new StreamCoordinates(reader.EnsureBigEndian().ReadArray(ReadStreamPosition)));
 }
 public static TimelineCoordinates Read(IBinaryReader reader)
 {
     return(new TimelineCoordinates(reader.EnsureBigEndian().ReadArray(ReadTimelinePosition)));
 }