Skip to content

YamlDocument.ConvertToYaml Method

Definition

Namespace: Corvus.Yaml
Assembly: Corvus.Text.Json.dll

Overloads

Method Description
ConvertToYaml(JsonElement, IBufferWriter<byte>, YamlWriterOptions) Converts a JsonElement to YAML, writing the output to the specified...
ConvertToYaml(JsonElement, Stream, YamlWriterOptions) Converts a JsonElement to YAML, writing the output to the specified...
ConvertToYaml(string, IBufferWriter<byte>, YamlWriterOptions) Converts a JSON string to YAML, writing the output to the specified IBufferWriter.
ConvertToYaml(ReadOnlySpan<byte>, IBufferWriter<byte>, YamlWriterOptions) Converts UTF-8 JSON bytes to YAML, writing the output to the specified IBufferWriter.
ConvertToYaml(string, Stream, YamlWriterOptions) Converts a JSON string to YAML, writing the output to the specified Stream.
ConvertToYaml(ReadOnlySpan<byte>, Stream, YamlWriterOptions) Converts UTF-8 JSON bytes to YAML, writing the output to the specified Stream.

ConvertToYaml(JsonElement, IBufferWriter<byte>, YamlWriterOptions)

Converts a JsonElement to YAML, writing the output to the specified IBufferWriter.

public static void ConvertToYaml(JsonElement element, IBufferWriter<byte> writer, YamlWriterOptions options)

Parameters

Name Type Description
element JsonElement The JSON element to convert.
writer IBufferWriter<byte> The buffer writer to write the YAML output to.
options YamlWriterOptions Optional YAML writer options. (optional)

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

ConvertToYaml(JsonElement, Stream, YamlWriterOptions)

Converts a JsonElement to YAML, writing the output to the specified Stream.

public static void ConvertToYaml(JsonElement element, Stream utf8Stream, YamlWriterOptions options)

Parameters

Name Type Description
element JsonElement The JSON element to convert.
utf8Stream Stream The stream to write the UTF-8 YAML output to.
options YamlWriterOptions Optional YAML writer options. (optional)

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

ConvertToYaml(string, IBufferWriter<byte>, YamlWriterOptions)

Converts a JSON string to YAML, writing the output to the specified IBufferWriter.

public static void ConvertToYaml(string json, IBufferWriter<byte> writer, YamlWriterOptions options)

Parameters

Name Type Description
json string The JSON content as a string.
writer IBufferWriter<byte> The buffer writer to write the YAML output to.
options YamlWriterOptions Optional YAML writer options. (optional)

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

ConvertToYaml(ReadOnlySpan<byte>, IBufferWriter<byte>, YamlWriterOptions)

Converts UTF-8 JSON bytes to YAML, writing the output to the specified IBufferWriter.

public static void ConvertToYaml(ReadOnlySpan<byte> utf8Json, IBufferWriter<byte> writer, YamlWriterOptions options)

Parameters

Name Type Description
utf8Json ReadOnlySpan<byte> The UTF-8 encoded JSON bytes.
writer IBufferWriter<byte> The buffer writer to write the YAML output to.
options YamlWriterOptions Optional YAML writer options. (optional)

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

ConvertToYaml(string, Stream, YamlWriterOptions)

Converts a JSON string to YAML, writing the output to the specified Stream.

public static void ConvertToYaml(string json, Stream utf8Stream, YamlWriterOptions options)

Parameters

Name Type Description
json string The JSON content as a string.
utf8Stream Stream The stream to write the UTF-8 YAML output to.
options YamlWriterOptions Optional YAML writer options. (optional)

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

ConvertToYaml(ReadOnlySpan<byte>, Stream, YamlWriterOptions)

Converts UTF-8 JSON bytes to YAML, writing the output to the specified Stream.

public static void ConvertToYaml(ReadOnlySpan<byte> utf8Json, Stream utf8Stream, YamlWriterOptions options)

Parameters

Name Type Description
utf8Json ReadOnlySpan<byte> The UTF-8 encoded JSON bytes.
utf8Stream Stream The stream to write the UTF-8 YAML output to.
options YamlWriterOptions Optional YAML writer options. (optional)

Applies To

Product Versions
.NET 9, 10
.NET Standard 2.0, 2.1

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests.

Open an issue