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.
Restores a value from a sequence of bytes.
Reads integer value encoded in big-endian format.
Decodes an integer encoded as 7-bit octets.
Reads integer value encoded in little-endian format.
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.
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.
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.