DotNext by .NET Foundation and Contributors

<PackageReference Include="DotNext" Version="5.17.0" />

.NET API 536,520 bytes

 ByteBuffer

public static class ByteBuffer
Providers extension methods to work with byte buffers.
public static int Format<T>(this IBufferWriter<byte> writer, T value, ReadOnlySpan<char> format = default, IFormatProvider provider = null) where T : IUtf8SpanFormattable

Formats the value as UTF-8 into the provided buffer.

public static int Format<T>(this ref BufferWriterSlim writer, T value, ReadOnlySpan<char> format = default, IFormatProvider provider = null) where T : IUtf8SpanFormattable

Formats the value as UTF-8 into the provided buffer.

public static T Read<T>(this ref SpanReader reader) where T : IBinaryFormattable<T>

Restores a value from a sequence of bytes.

public static T ReadBigEndian<T>(this ref SpanReader reader) where T : IBinaryInteger<T>

Reads integer value encoded in big-endian format.

public static T ReadLeb128<T>(this ref SpanReader reader) where T : struct, IBinaryInteger<T>

Decodes an integer encoded as 7-bit octets.

public static T ReadLittleEndian<T>(this ref SpanReader reader) where T : IBinaryInteger<T>

Reads integer value encoded in little-endian format.

public static bool TryEncodeAsUtf8(this ref SpanWriter writer, ReadOnlySpan<char> input)

Writes the specified sequence of characters as UTF-8 encoded octets.

public static bool TryFormat<T>(this ref SpanWriter writer, T value, ReadOnlySpan<char> format = default, IFormatProvider provider = null) where T : IUtf8SpanFormattable

Tries to format the value as UTF-8 into the provided buffer.

public static bool TryRead<T>(this ref SpanReader reader, out T value) where T : IBinaryFormattable<T>

Tries to restore a value from a sequence of bytes.

public static bool TryWrite<T>(this ref SpanWriter writer, T value) where T : IBinaryFormattable<T>

Tries to write the value as a sequence of bytes to the buffer.

public static bool TryWrite(this ref SpanWriter writer, ref BigInteger value, bool isBigEndian = false, bool isUnsigned = false)

Writes BigInteger value to the buffer.

public static void Write<T>(this IBufferWriter<byte> writer, T value) where T : IBinaryFormattable<T>

Writes the value as a sequence of bytes to the buffer.

public static int Write(this IBufferWriter<byte> writer, ref BigInteger value, bool isBigEndian = false, bool isUnsigned = false)

Writes BigInteger value to the buffer.

public static void Write<T>(this ref BufferWriterSlim writer, T value) where T : IBinaryFormattable<T>

Writes the value as a sequence of bytes to the buffer.

public static int Write(this ref BufferWriterSlim writer, ref BigInteger value, bool isBigEndian = false, bool isUnsigned = false)

Writes BigInteger value to the buffer.

public static void Write<T>(this ref SpanWriter writer, T value) where T : IBinaryFormattable<T>

Writes the value as a sequence of bytes to the buffer.

public static int WriteBigEndian<T>(this IBufferWriter<byte> writer, T value) where T : IBinaryInteger<T>

Writes integer in big-endian format.

public static int WriteBigEndian<T>(this ref BufferWriterSlim writer, T value) where T : IBinaryInteger<T>

Writes integer in big-endian format.

public static int WriteBigEndian<T>(this ref SpanWriter writer, T value) where T : IBinaryInteger<T>

Writes integer in big-endian format.

public static int WriteLeb128<T>(this ref SpanWriter writer, T value) where T : struct, IBinaryInteger<T>

Writes 32-bit integer in a compressed format.

public static int WriteLeb128<T>(this ref BufferWriterSlim writer, T value) where T : struct, IBinaryInteger<T>

Writes 32-bit integer in a compressed format.

public static int WriteLittleEndian<T>(this IBufferWriter<byte> writer, T value) where T : IBinaryInteger<T>

Writes integer in little-endian format.

public static int WriteLittleEndian<T>(this ref BufferWriterSlim writer, T value) where T : IBinaryInteger<T>

Writes integer in little-endian format.

public static int WriteLittleEndian<T>(this ref SpanWriter writer, T value) where T : IBinaryInteger<T>

Writes integer in little-endian format.