Class BufferWriter
Represents extension methods for writting typed data into buffer.
Inherited Members
Namespace: DotNext.Buffers
Assembly: DotNext.IO.dll
Syntax
public static class BufferWriter
Methods
| Improve this Doc View SourceBuildString(MemoryWriter<Char>)
Constructs the string from the buffer.
Declaration
[Obsolete("Use BufferHelpers class instead", true)]
public static string BuildString(MemoryWriter<char> writer)
Parameters
Type | Name | Description |
---|---|---|
MemoryWriter<Char> | writer | The buffer of characters. |
Returns
Type | Description |
---|---|
String | The string constructed from the buffer. |
BuildString(ArrayBufferWriter<Char>)
Constructs the string from the buffer.
Declaration
[Obsolete("Use BufferHelpers class instead", true)]
public static string BuildString(ArrayBufferWriter<char> writer)
Parameters
Type | Name | Description |
---|---|---|
ArrayBufferWriter<Char> | writer | The buffer of characters. |
Returns
Type | Description |
---|---|
String | The string constructed from the buffer. |
Write<T>(IBufferWriter<T>, T)
Writes single element to the buffer.
Declaration
[Obsolete("Use BufferHelpers.Write extension method instead", true)]
public static void Write<T>(IBufferWriter<T> writer, T value)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<T> | writer | The buffer writer. |
T | value | The value to add. |
Type Parameters
Name | Description |
---|---|
T | The type of elements in the buffer. |
Write<T>(IBufferWriter<T>, T[], Int32, Int32)
Writes the array to the buffer.
Declaration
[Obsolete("Use BuffersExtensions.Write extension method instead")]
public static void Write<T>(this IBufferWriter<T> writer, T[] buffer, int startIndex, int count)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<T> | writer | The buffer writer. |
T[] | buffer | The buffer to write. |
Int32 | startIndex | Start index in the buffer. |
Int32 | count | The number of elements in the buffer. to write. |
Type Parameters
Name | Description |
---|---|
T | The type of the elements in the buffer. |
Write<T>(IBufferWriter<T>, ReadOnlySequence<T>, CancellationToken)
Writes the sequence of elements to the buffer.
Declaration
public static long Write<T>(this IBufferWriter<T> writer, ReadOnlySequence<T> value, CancellationToken token = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<T> | writer | The buffer writer. |
ReadOnlySequence<T> | value | The sequence of elements to be written. |
CancellationToken | token | The token that can be used to cancel the operation. |
Returns
Type | Description |
---|---|
Int64 | The number of written elements. |
Type Parameters
Name | Description |
---|---|
T | The type of the elements in the sequence. |
Exceptions
Type | Condition |
---|---|
OperationCanceledException | The operation has been canceled. |
Write<T>(IBufferWriter<Byte>, T)
Encodes value of blittable type.
Declaration
public static void Write<T>(this IBufferWriter<byte> writer, in T value)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | The buffer writer. |
T | value | The value to write. |
Type Parameters
Name | Description |
---|---|
T | The blittable type to encode. |
WriteByte(IBufferWriter<Byte>, Byte, StringLengthEncoding, EncodingContext, ReadOnlySpan<Char>, IFormatProvider, Int32)
Encodes 8-bit unsigned integer as a string.
Declaration
public static void WriteByte(this IBufferWriter<byte> writer, byte value, StringLengthEncoding lengthFormat, in EncodingContext context, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null, int bufferSize = 0)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | The buffer writer. |
Byte | value | The value to encode. |
StringLengthEncoding | lengthFormat | String length encoding format. |
EncodingContext | context | The encoding context. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
Int32 | bufferSize | The buffer size (in bytes) used for encoding. |
WriteByte(IBufferWriter<Char>, Byte, ReadOnlySpan<Char>, IFormatProvider)
Writes string representation of 8-bit unsigned integer to the buffer.
Declaration
public static void WriteByte(this IBufferWriter<char> writer, byte value, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Char> | writer | The buffer writer. |
Byte | value | The value to write. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
WriteDateTime(IBufferWriter<Byte>, DateTime, StringLengthEncoding, EncodingContext, ReadOnlySpan<Char>, IFormatProvider, Int32)
Encodes DateTime as a string.
Declaration
public static void WriteDateTime(this IBufferWriter<byte> writer, DateTime value, StringLengthEncoding lengthFormat, in EncodingContext context, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null, int bufferSize = 0)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | The buffer writer. |
DateTime | value | The value to encode. |
StringLengthEncoding | lengthFormat | String length encoding format. |
EncodingContext | context | The encoding context. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
Int32 | bufferSize | The buffer size (in bytes) used for encoding. |
WriteDateTime(IBufferWriter<Char>, DateTime, ReadOnlySpan<Char>, IFormatProvider)
Writes string representation of DateTime to the buffer.
Declaration
public static void WriteDateTime(this IBufferWriter<char> writer, DateTime value, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Char> | writer | The buffer writer. |
DateTime | value | The value to write. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
WriteDateTimeOffset(IBufferWriter<Byte>, DateTimeOffset, StringLengthEncoding, EncodingContext, ReadOnlySpan<Char>, IFormatProvider, Int32)
Encodes DateTimeOffset as a string.
Declaration
public static void WriteDateTimeOffset(this IBufferWriter<byte> writer, DateTimeOffset value, StringLengthEncoding lengthFormat, in EncodingContext context, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null, int bufferSize = 0)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | The buffer writer. |
DateTimeOffset | value | The value to encode. |
StringLengthEncoding | lengthFormat | String length encoding format. |
EncodingContext | context | The encoding context. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
Int32 | bufferSize | The buffer size (in bytes) used for encoding. |
WriteDateTimeOffset(IBufferWriter<Char>, DateTimeOffset, ReadOnlySpan<Char>, IFormatProvider)
Writes string representation of DateTimeOffset to the buffer.
Declaration
public static void WriteDateTimeOffset(this IBufferWriter<char> writer, DateTimeOffset value, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Char> | writer | The buffer writer. |
DateTimeOffset | value | The value to write. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
WriteDecimal(IBufferWriter<Byte>, Decimal, StringLengthEncoding, EncodingContext, ReadOnlySpan<Char>, IFormatProvider, Int32)
Encodes Decimal as a string.
Declaration
public static void WriteDecimal(this IBufferWriter<byte> writer, decimal value, StringLengthEncoding lengthFormat, in EncodingContext context, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null, int bufferSize = 0)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | The buffer writer. |
Decimal | value | The value to encode. |
StringLengthEncoding | lengthFormat | String length encoding format. |
EncodingContext | context | The encoding context. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
Int32 | bufferSize | The buffer size (in bytes) used for encoding. |
WriteDecimal(IBufferWriter<Char>, Decimal, ReadOnlySpan<Char>, IFormatProvider)
Writes string representation of Decimal to the buffer.
Declaration
public static void WriteDecimal(this IBufferWriter<char> writer, decimal value, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Char> | writer | The buffer writer. |
Decimal | value | The value to write. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
WriteDouble(IBufferWriter<Byte>, Double, StringLengthEncoding, EncodingContext, ReadOnlySpan<Char>, IFormatProvider, Int32)
Encodes double-precision floating-point number as a string.
Declaration
public static void WriteDouble(this IBufferWriter<byte> writer, double value, StringLengthEncoding lengthFormat, in EncodingContext context, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null, int bufferSize = 0)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | The buffer writer. |
Double | value | The value to encode. |
StringLengthEncoding | lengthFormat | String length encoding format. |
EncodingContext | context | The encoding context. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
Int32 | bufferSize | The buffer size (in bytes) used for encoding. |
WriteDouble(IBufferWriter<Char>, Double, ReadOnlySpan<Char>, IFormatProvider)
Writes string representation of double-precision floating-point number to the buffer.
Declaration
public static void WriteDouble(this IBufferWriter<char> writer, double value, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Char> | writer | The buffer writer. |
Double | value | The value to write. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
WriteGuid(IBufferWriter<Byte>, Guid, StringLengthEncoding, EncodingContext, ReadOnlySpan<Char>, Int32)
Encodes Guid as a string.
Declaration
public static void WriteGuid(this IBufferWriter<byte> writer, Guid value, StringLengthEncoding lengthFormat, in EncodingContext context, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), int bufferSize = 0)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | The buffer writer. |
Guid | value | The value to encode. |
StringLengthEncoding | lengthFormat | String length encoding format. |
EncodingContext | context | The encoding context. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
Int32 | bufferSize | The buffer size (in bytes) used for encoding. |
WriteGuid(IBufferWriter<Char>, Guid, ReadOnlySpan<Char>)
Writes string representation of Guid to the buffer.
Declaration
public static void WriteGuid(this IBufferWriter<char> writer, Guid value, ReadOnlySpan<char> format = default(ReadOnlySpan<char>))
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Char> | writer | The buffer writer. |
Guid | value | The value to write. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
WriteInt16(IBufferWriter<Byte>, Int16, StringLengthEncoding, EncodingContext, ReadOnlySpan<Char>, IFormatProvider, Int32)
Encodes 16-bit signed integer as a string.
Declaration
public static void WriteInt16(this IBufferWriter<byte> writer, short value, StringLengthEncoding lengthFormat, in EncodingContext context, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null, int bufferSize = 0)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | The buffer writer. |
Int16 | value | The value to encode. |
StringLengthEncoding | lengthFormat | String length encoding format. |
EncodingContext | context | The encoding context. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
Int32 | bufferSize | The buffer size (in bytes) used for encoding. |
WriteInt16(IBufferWriter<Byte>, Int16, Boolean)
Encodes 16-bit signed integer.
Declaration
public static void WriteInt16(this IBufferWriter<byte> writer, short value, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | The buffer writer. |
Int16 | value | The value to encode. |
Boolean | littleEndian | true to use little-endian encoding; false to use big-endian encoding. |
WriteInt16(IBufferWriter<Char>, Int16, ReadOnlySpan<Char>, IFormatProvider)
Writes string representation of 16-bit signed integer to the buffer.
Declaration
public static void WriteInt16(this IBufferWriter<char> writer, short value, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Char> | writer | The buffer writer. |
Int16 | value | The value to write. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
WriteInt32(IBufferWriter<Byte>, Int32, StringLengthEncoding, EncodingContext, ReadOnlySpan<Char>, IFormatProvider, Int32)
Encodes 32-bit signed integer as a string.
Declaration
public static void WriteInt32(this IBufferWriter<byte> writer, int value, StringLengthEncoding lengthFormat, in EncodingContext context, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null, int bufferSize = 0)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | The buffer writer. |
Int32 | value | The value to encode. |
StringLengthEncoding | lengthFormat | String length encoding format. |
EncodingContext | context | The encoding context. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
Int32 | bufferSize | The buffer size (in bytes) used for encoding. |
WriteInt32(IBufferWriter<Byte>, Int32, Boolean)
Encodes 32-bit signed integer.
Declaration
public static void WriteInt32(this IBufferWriter<byte> writer, int value, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | The buffer writer. |
Int32 | value | The value to encode. |
Boolean | littleEndian | true to use little-endian encoding; false to use big-endian encoding. |
WriteInt32(IBufferWriter<Char>, Int32, ReadOnlySpan<Char>, IFormatProvider)
Writes string representation of 32-bit signed integer to the buffer.
Declaration
public static void WriteInt32(this IBufferWriter<char> writer, int value, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Char> | writer | The buffer writer. |
Int32 | value | The value to write. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
WriteInt64(IBufferWriter<Byte>, Int64, StringLengthEncoding, EncodingContext, ReadOnlySpan<Char>, IFormatProvider, Int32)
Encodes 64-bit signed integer as a string.
Declaration
public static void WriteInt64(this IBufferWriter<byte> writer, long value, StringLengthEncoding lengthFormat, in EncodingContext context, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null, int bufferSize = 0)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | The buffer writer. |
Int64 | value | The value to encode. |
StringLengthEncoding | lengthFormat | String length encoding format. |
EncodingContext | context | The encoding context. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
Int32 | bufferSize | The buffer size (in bytes) used for encoding. |
WriteInt64(IBufferWriter<Byte>, Int64, Boolean)
Encodes 64-bit signed integer.
Declaration
public static void WriteInt64(this IBufferWriter<byte> writer, long value, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | The buffer writer. |
Int64 | value | The value to encode. |
Boolean | littleEndian | true to use little-endian encoding; false to use big-endian encoding. |
WriteInt64(IBufferWriter<Char>, Int64, ReadOnlySpan<Char>, IFormatProvider)
Writes string representation of 64-bit signed integer to the buffer.
Declaration
public static void WriteInt64(this IBufferWriter<char> writer, long value, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Char> | writer | The buffer writer. |
Int64 | value | The value to write. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
WriteLine(IBufferWriter<Char>)
Writes line termination symbols to the buffer.
Declaration
public static void WriteLine(this IBufferWriter<char> writer)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Char> | writer | The buffer writer. |
WriteLine(IBufferWriter<Char>, ReadOnlySpan<Char>)
Writes a string to the buffer, followed by a line terminator.
Declaration
public static void WriteLine(this IBufferWriter<char> writer, ReadOnlySpan<char> characters)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Char> | writer | The buffer writer. |
ReadOnlySpan<Char> | characters | The characters to write. |
WriteSByte(IBufferWriter<Byte>, SByte, StringLengthEncoding, EncodingContext, ReadOnlySpan<Char>, IFormatProvider, Int32)
Encodes 8-bit signed integer as a string.
Declaration
[CLSCompliant(false)]
public static void WriteSByte(this IBufferWriter<byte> writer, sbyte value, StringLengthEncoding lengthFormat, in EncodingContext context, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null, int bufferSize = 0)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | The buffer writer. |
SByte | value | The value to encode. |
StringLengthEncoding | lengthFormat | String length encoding format. |
EncodingContext | context | The encoding context. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
Int32 | bufferSize | The buffer size (in bytes) used for encoding. |
WriteSByte(IBufferWriter<Char>, SByte, ReadOnlySpan<Char>, IFormatProvider)
Writes string representation of 8-bit signed integer to the buffer.
Declaration
[CLSCompliant(false)]
public static void WriteSByte(this IBufferWriter<char> writer, sbyte value, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Char> | writer | The buffer writer. |
SByte | value | The value to write. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
WriteSingle(IBufferWriter<Byte>, Single, StringLengthEncoding, EncodingContext, ReadOnlySpan<Char>, IFormatProvider, Int32)
Encodes single-precision floating-point number as a string.
Declaration
public static void WriteSingle(this IBufferWriter<byte> writer, float value, StringLengthEncoding lengthFormat, in EncodingContext context, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null, int bufferSize = 0)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | The buffer writer. |
Single | value | The value to encode. |
StringLengthEncoding | lengthFormat | String length encoding format. |
EncodingContext | context | The encoding context. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
Int32 | bufferSize | The buffer size (in bytes) used for encoding. |
WriteSingle(IBufferWriter<Char>, Single, ReadOnlySpan<Char>, IFormatProvider)
Writes string representation of single-precision floating-point number to the buffer.
Declaration
public static void WriteSingle(this IBufferWriter<char> writer, float value, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Char> | writer | The buffer writer. |
Single | value | The value to write. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
WriteString(IBufferWriter<Byte>, ReadOnlySpan<Char>, EncodingContext, Int32, Nullable<StringLengthEncoding>)
Encodes string using the specified encoding.
Declaration
public static void WriteString(this IBufferWriter<byte> writer, ReadOnlySpan<char> value, in EncodingContext context, int bufferSize = 0, StringLengthEncoding? lengthFormat = default(StringLengthEncoding? ))
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | The buffer writer. |
ReadOnlySpan<Char> | value | The sequence of characters. |
EncodingContext | context | The encoding context. |
Int32 | bufferSize | The buffer size (in bytes) used for encoding. |
Nullable<StringLengthEncoding> | lengthFormat | String length encoding format; or null to prevent encoding of string length. |
WriteTimeSpan(IBufferWriter<Byte>, TimeSpan, StringLengthEncoding, EncodingContext, ReadOnlySpan<Char>, IFormatProvider, Int32)
Encodes TimeSpan as a string.
Declaration
public static void WriteTimeSpan(this IBufferWriter<byte> writer, TimeSpan value, StringLengthEncoding lengthFormat, in EncodingContext context, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null, int bufferSize = 0)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | The buffer writer. |
TimeSpan | value | The value to encode. |
StringLengthEncoding | lengthFormat | String length encoding format. |
EncodingContext | context | The encoding context. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
Int32 | bufferSize | The buffer size (in bytes) used for encoding. |
WriteTimeSpan(IBufferWriter<Char>, TimeSpan, ReadOnlySpan<Char>, IFormatProvider)
Writes string representation of TimeSpan to the buffer.
Declaration
public static void WriteTimeSpan(this IBufferWriter<char> writer, TimeSpan value, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Char> | writer | The buffer writer. |
TimeSpan | value | The value to write. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
WriteUInt16(IBufferWriter<Byte>, UInt16, StringLengthEncoding, EncodingContext, ReadOnlySpan<Char>, IFormatProvider, Int32)
Encodes 16-bit unsigned integer as a string.
Declaration
[CLSCompliant(false)]
public static void WriteUInt16(this IBufferWriter<byte> writer, ushort value, StringLengthEncoding lengthFormat, in EncodingContext context, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null, int bufferSize = 0)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | The buffer writer. |
UInt16 | value | The value to encode. |
StringLengthEncoding | lengthFormat | String length encoding format. |
EncodingContext | context | The encoding context. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
Int32 | bufferSize | The buffer size (in bytes) used for encoding. |
WriteUInt16(IBufferWriter<Byte>, UInt16, Boolean)
Encodes 16-bit unsigned integer.
Declaration
[CLSCompliant(false)]
public static void WriteUInt16(this IBufferWriter<byte> writer, ushort value, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | The buffer writer. |
UInt16 | value | The value to encode. |
Boolean | littleEndian | true to use little-endian encoding; false to use big-endian encoding. |
WriteUInt16(IBufferWriter<Char>, UInt16, ReadOnlySpan<Char>, IFormatProvider)
Writes string representation of 16-bit unsigned integer to the buffer.
Declaration
[CLSCompliant(false)]
public static void WriteUInt16(this IBufferWriter<char> writer, ushort value, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Char> | writer | The buffer writer. |
UInt16 | value | The value to write. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
WriteUInt32(IBufferWriter<Byte>, UInt32, StringLengthEncoding, EncodingContext, ReadOnlySpan<Char>, IFormatProvider, Int32)
Encodes 32-bit unsigned integer as a string.
Declaration
[CLSCompliant(false)]
public static void WriteUInt32(this IBufferWriter<byte> writer, uint value, StringLengthEncoding lengthFormat, in EncodingContext context, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null, int bufferSize = 0)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | The buffer writer. |
UInt32 | value | The value to encode. |
StringLengthEncoding | lengthFormat | String length encoding format. |
EncodingContext | context | The encoding context. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
Int32 | bufferSize | The buffer size (in bytes) used for encoding. |
WriteUInt32(IBufferWriter<Byte>, UInt32, Boolean)
Encodes 32-bit unsigned integer.
Declaration
[CLSCompliant(false)]
public static void WriteUInt32(this IBufferWriter<byte> writer, uint value, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | The buffer writer. |
UInt32 | value | The value to encode. |
Boolean | littleEndian | true to use little-endian encoding; false to use big-endian encoding. |
WriteUInt32(IBufferWriter<Char>, UInt32, ReadOnlySpan<Char>, IFormatProvider)
Writes string representation of 32-bit unsigned integer to the buffer.
Declaration
[CLSCompliant(false)]
public static void WriteUInt32(this IBufferWriter<char> writer, uint value, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Char> | writer | The buffer writer. |
UInt32 | value | The value to write. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
WriteUInt64(IBufferWriter<Byte>, UInt64, StringLengthEncoding, EncodingContext, ReadOnlySpan<Char>, IFormatProvider, Int32)
Encodes 64-bit unsigned integer as a string.
Declaration
[CLSCompliant(false)]
public static void WriteUInt64(this IBufferWriter<byte> writer, ulong value, StringLengthEncoding lengthFormat, in EncodingContext context, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null, int bufferSize = 0)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | The buffer writer. |
UInt64 | value | The value to encode. |
StringLengthEncoding | lengthFormat | String length encoding format. |
EncodingContext | context | The encoding context. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |
Int32 | bufferSize | The buffer size (in bytes) used for encoding. |
WriteUInt64(IBufferWriter<Byte>, UInt64, Boolean)
Encodes 64-bit unsigned integer.
Declaration
[CLSCompliant(false)]
public static void WriteUInt64(this IBufferWriter<byte> writer, ulong value, bool littleEndian)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Byte> | writer | The buffer writer. |
UInt64 | value | The value to encode. |
Boolean | littleEndian | true to use little-endian encoding; false to use big-endian encoding. |
WriteUInt64(IBufferWriter<Char>, UInt64, ReadOnlySpan<Char>, IFormatProvider)
Writes string representation of 64-bit unsigned integer to the buffer.
Declaration
[CLSCompliant(false)]
public static void WriteUInt64(this IBufferWriter<char> writer, ulong value, ReadOnlySpan<char> format = default(ReadOnlySpan<char>), IFormatProvider provider = null)
Parameters
Type | Name | Description |
---|---|---|
IBufferWriter<Char> | writer | The buffer writer. |
UInt64 | value | The value to write. |
ReadOnlySpan<Char> | format | A span containing the characters that represent a standard or custom format string. |
IFormatProvider | provider | An optional object that supplies culture-specific formatting information. |