Esempio n. 1
0
        public static ReadOnlyMemorySlice <byte> ExtractGroupMemory(ReadOnlyMemorySlice <byte> span, GameConstants meta)
        {
            var groupMeta = meta.Group(span.Span);
            var len       = groupMeta.ContentLength;

            len += (byte)meta.GroupConstants.LengthAfterLength;
            return(span.Slice(meta.GroupConstants.TypeAndLengthLength, checked ((int)len)));
        }
Esempio n. 2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="meta">Game metadata to use as reference for alignment</param>
 /// <param name="span">Span to overlay on, aligned to the start of the header</param>
 public GroupMemoryFrame(GameConstants meta, ReadOnlyMemorySlice <byte> span)
 {
     this.Header = meta.Group(span);
     this.HeaderAndContentData = span.Slice(0, checked ((int)this.Header.TotalLength));
 }