Exemplo n.º 1
0
    private static void CopyOverHeader(RecordLocatorResults fileLocs, IMutagenReadStream inputStream, BinaryWriter writer)
    {
        long noRecordLength;

        if (fileLocs.GrupLocations.TryGetInDirection(
                inputStream.Position,
                higher: true,
                result: out var nextRec))
        {
            noRecordLength = nextRec.Value.Location.Min - inputStream.Position;
        }
        else
        {
            noRecordLength = inputStream.Remaining;
        }

        inputStream.WriteTo(writer.BaseStream, (int)noRecordLength);
    }