public bool TryReadGroupFrame(IBinaryReadStream stream, out GroupFrame frame, bool checkIsGroup = true) { if (!TryGetGroup(stream, out var meta, checkIsGroup: checkIsGroup)) { frame = default; return(false); } frame = new GroupFrame(meta, stream.ReadSpan(checked ((int)meta.TotalLength))); return(true); }
// Not an extension method, as we don't want it to show up as intellisense, as it's already part of a GroupFrame's enumerator. /// <summary> /// Enumerates locations of the contained subrecords.<br/> /// Locations are relative to the RecordType of the MajorRecordFrame. /// </summary> public static IEnumerable <MajorRecordPinFrame> EnumerateRecords(GroupFrame group) { int loc = group.HeaderLength; while (loc < group.HeaderAndContentData.Length) { var subHeader = new MajorRecordPinFrame(group.Meta, group.HeaderAndContentData.Slice(loc), loc); yield return(subHeader); loc = checked ((int)(loc + subHeader.TotalLength)); } }
public static bool TryReadGroupFrame(this IMutagenReadStream stream, out GroupFrame frame, bool checkIsGroup = true) => stream.MetaData.Constants.TryReadGroupFrame(stream, out frame, checkIsGroup);
public static bool TryGetGroupFrame(this IMutagenReadStream stream, out GroupFrame header, int offset = 0, bool checkIsGroup = true) => stream.MetaData.Constants.TryGetGroupFrame(stream, out header, offset, checkIsGroup);