using System; using System.IO; using System.Text.Json; public class Program { public static void Main(string[] args) { var options = new JsonSerializerOptions { WriteIndented = true }; using var stream = new MemoryStream(); using var writer = new Utf8JsonWriter(stream); writer.SetIndentationLevel(2); writer.WriteStartArray(); writer.WriteStartObject(); writer.WriteString("name", "John"); writer.WriteString("surname", "Doe"); writer.WriteNumber("age", 30); writer.WriteEndObject(); writer.WriteStartObject(); writer.WriteString("name", "Jane"); writer.WriteString("surname", "Doe"); writer.WriteNumber("age", 28); writer.WriteEndObject(); writer.WriteEndArray(); writer.Flush(); var result = Encoding.UTF8.GetString(stream.ToArray()); Console.WriteLine(result); } }In this example, we create a JSON output using the `Utf8JsonWriter` class. We set the indentation level to 2 using the `SetIndentationLevel` method of the writer object. This ensures that the resulting JSON is formatted with an indentation level of 2 spaces. The `WriteIndented` property of `JsonSerializerOptions` is also set to `true` to ensure that the output is indented. The package that includes the ITextOutput Indent interface is likely to be part of the .NET Core runtime libraries. Specifically, it is part of the `Microsoft.DotNet.PlatformAbstractions` package.