public async Task TestMethod1Async()
        {
            await using var inCsf   = new FileStream("InCsf.csf", FileMode.Open);
            await using var outJson = new FileStream("OutJson.json", FileMode.Create);
            await using var outCsf  = new FileStream("OutCsf.csf", FileMode.Create);
            var csfStruct = CsfStructUtils.Serialize(inCsf);
            var options   = CsfJsonConverterUtils.CsfJsonSerializerOptions;
            await JsonSerializer.SerializeAsync(outJson, csfStruct, options);

            outJson.Seek(0, SeekOrigin.Begin);
            var csfStruct1 = await JsonSerializer.DeserializeAsync <CsfStruct>(outJson, options);

            csfStruct1.Deserialize(outCsf);
        }
Beispiel #2
0
 static Task Csf2Json(Stream input, Stream output)
 => JsonSerializer.SerializeAsync(output, CsfStructUtils.Serialize(input), CsfJsonConverterUtils.CsfJsonSerializerOptions);