System.IO.Compression.RunLengthEncoder
Simple run length encoder (RLE) that works on spans.
namespace System.IO.Compression
{
internal static class RunLengthEncoder
{
public static int GetEncodedLength(ReadOnlySpan<byte> data);
public static int GetDecodedLength(ReadOnlySpan<byte> encoded);
public static bool TryEncode(ReadOnlySpan<byte> data, Span<byte> encoded, out int written);
public static bool TryDecode(ReadOnlySpan<byte> encoded, Span<byte> data, out int written);
}
}