Skip to content

RawUtf8JsonString

Definition

Namespace: Corvus.Text.Json
Assembly: Corvus.Text.Json.dll
Source: RawUtf8JsonString.cs

Represents a raw UTF-8 JSON string.

public readonly struct RawUtf8JsonString : IDisposable

Remarks

This may use a rented buffer to back the string, so it is disposable.

Implements

IDisposable

Constructors

Constructor Description
RawUtf8JsonString(ReadOnlyMemory<byte>, byte[]) Initializes a new instance of the RawUtf8JsonString struct.

Properties

Property Type Description
Memory ReadOnlyMemory<byte> Gets the underlying UTF-8 bytes as a ReadOnlyMemory.
Span ReadOnlySpan<byte> Gets the underlying UTF-8 bytes as a ReadOnlySpan.

Methods

Method Description
Dispose() Releases any rented array pool bytes and clears sensitive data.
TakeOwnership(ref byte[]) Takes ownership of the underlying memory and any extra rented array pool bytes.

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