Class TextWriterExtensions
IO-related extension methods for
Inheritance
Namespace: X10D.IO
Assembly: X10D.dll
Syntax
public static class TextWriterExtensions : object
Methods
| Improve this Doc View SourceWriteLineNoAlloc(TextWriter, Double)
Writes the text representation of an 8-byte floating-point value to the text stream, followed by a line terminator, without allocating a string.
Declaration
public static void WriteLineNoAlloc(this TextWriter writer, double value)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Double | value | The 8-byte floating-point value to write. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteLineNoAlloc(TextWriter, Double, ReadOnlySpan<Char>)
Writes the text representation of an 8-byte floating-point value to the text stream, followed by a line terminator, without allocating a string.
Declaration
public static void WriteLineNoAlloc(this TextWriter writer, double value, ReadOnlySpan<char> format)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Double | value | The 8-byte floating-point value to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteLineNoAlloc(TextWriter, Double, ReadOnlySpan<Char>, Nullable<IFormatProvider>)
Writes the text representation of an 8-byte floating-point value to the text stream, followed by a line terminator, without allocating a string.
Declaration
public static void WriteLineNoAlloc(this TextWriter writer, double value, ReadOnlySpan<char> format, IFormatProvider? formatProvider)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Double | value | The 8-byte floating-point value to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
System.Nullable<IFormatProvider> | formatProvider | An object that supplies culture-specific formatting information. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteLineNoAlloc(TextWriter, Int32)
Writes the text representation of a 4-byte signed integer to the text stream, followed by a line terminator, without allocating a string.
Declaration
public static void WriteLineNoAlloc(this TextWriter writer, int value)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Int32 | value | The 4-byte signed integer to write. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteLineNoAlloc(TextWriter, Int32, ReadOnlySpan<Char>)
Writes the text representation of a 4-byte signed integer to the text stream, followed by a line terminator, without allocating a string.
Declaration
public static void WriteLineNoAlloc(this TextWriter writer, int value, ReadOnlySpan<char> format)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Int32 | value | The 4-byte signed integer to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteLineNoAlloc(TextWriter, Int32, ReadOnlySpan<Char>, Nullable<IFormatProvider>)
Writes the text representation of a 4-byte signed integer to the text stream, followed by a line terminator, without allocating a string.
Declaration
public static void WriteLineNoAlloc(this TextWriter writer, int value, ReadOnlySpan<char> format, IFormatProvider? formatProvider)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Int32 | value | The 4-byte signed integer to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
System.Nullable<IFormatProvider> | formatProvider | An object that supplies culture-specific formatting information. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteLineNoAlloc(TextWriter, Int64)
Writes the text representation of an 8-byte signed integer to the text stream, followed by a line terminator, without allocating a string.
Declaration
public static void WriteLineNoAlloc(this TextWriter writer, long value)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Int64 | value | The 8-byte signed integer to write. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteLineNoAlloc(TextWriter, Int64, ReadOnlySpan<Char>)
Writes the text representation of an 8-byte signed integer to the text stream, followed by a line terminator, without allocating a string.
Declaration
public static void WriteLineNoAlloc(this TextWriter writer, long value, ReadOnlySpan<char> format)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Int64 | value | The 8-byte signed integer to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteLineNoAlloc(TextWriter, Int64, ReadOnlySpan<Char>, Nullable<IFormatProvider>)
Writes the text representation of an 8-byte signed integer to the text stream, followed by a line terminator, without allocating a string.
Declaration
public static void WriteLineNoAlloc(this TextWriter writer, long value, ReadOnlySpan<char> format, IFormatProvider? formatProvider)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Int64 | value | The 8-byte signed integer to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
System.Nullable<IFormatProvider> | formatProvider | An object that supplies culture-specific formatting information. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteLineNoAlloc(TextWriter, Single)
Writes the text representation of a 4-byte floating-point value to the text stream, followed by a line terminator, without allocating a string.
Declaration
public static void WriteLineNoAlloc(this TextWriter writer, float value)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Single | value | The 4-byte floating-point value to write. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteLineNoAlloc(TextWriter, Single, ReadOnlySpan<Char>)
Writes the text representation of a 4-byte floating-point value to the text stream, followed by a line terminator, without allocating a string.
Declaration
public static void WriteLineNoAlloc(this TextWriter writer, float value, ReadOnlySpan<char> format)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Single | value | The 4-byte floating-point value to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteLineNoAlloc(TextWriter, Single, ReadOnlySpan<Char>, Nullable<IFormatProvider>)
Writes the text representation of a 4-byte floating-point value to the text stream, followed by a line terminator, without allocating a string.
Declaration
public static void WriteLineNoAlloc(this TextWriter writer, float value, ReadOnlySpan<char> format, IFormatProvider? formatProvider)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Single | value | The 4-byte floating-point value to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
System.Nullable<IFormatProvider> | formatProvider | An object that supplies culture-specific formatting information. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteLineNoAlloc(TextWriter, UInt32)
Writes the text representation of a 4-byte unsigned integer to the text stream, followed by a line terminator, without allocating a string.
Declaration
public static void WriteLineNoAlloc(this TextWriter writer, uint value)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.UInt32 | value | The 4-byte unsigned integer to write. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteLineNoAlloc(TextWriter, UInt32, ReadOnlySpan<Char>)
Writes the text representation of a 4-byte unsigned integer to the text stream, followed by a line terminator, without allocating a string.
Declaration
public static void WriteLineNoAlloc(this TextWriter writer, uint value, ReadOnlySpan<char> format)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.UInt32 | value | The 4-byte unsigned integer to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteLineNoAlloc(TextWriter, UInt32, ReadOnlySpan<Char>, Nullable<IFormatProvider>)
Writes the text representation of a 4-byte unsigned integer to the text stream, followed by a line terminator, without allocating a string.
Declaration
public static void WriteLineNoAlloc(this TextWriter writer, uint value, ReadOnlySpan<char> format, IFormatProvider? formatProvider)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.UInt32 | value | The 4-byte unsigned integer to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
System.Nullable<IFormatProvider> | formatProvider | An object that supplies culture-specific formatting information. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteLineNoAlloc(TextWriter, UInt64)
Writes the text representation of an 8-byte unsigned integer to the text stream, followed by a line terminator, without allocating a string.
Declaration
public static void WriteLineNoAlloc(this TextWriter writer, ulong value)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.UInt64 | value | The 8-byte unsigned integer to write. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteLineNoAlloc(TextWriter, UInt64, ReadOnlySpan<Char>)
Writes the text representation of an 8-byte unsigned integer to the text stream, followed by a line terminator, without allocating a string.
Declaration
public static void WriteLineNoAlloc(this TextWriter writer, ulong value, ReadOnlySpan<char> format)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.UInt64 | value | The 8-byte unsigned integer to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteLineNoAlloc(TextWriter, UInt64, ReadOnlySpan<Char>, Nullable<IFormatProvider>)
Writes the text representation of an 8-byte unsigned integer to the text stream, followed by a line terminator, without allocating a string.
Declaration
public static void WriteLineNoAlloc(this TextWriter writer, ulong value, ReadOnlySpan<char> format, IFormatProvider? formatProvider)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.UInt64 | value | The 8-byte unsigned integer to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
System.Nullable<IFormatProvider> | formatProvider | An object that supplies culture-specific formatting information. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteNoAlloc(TextWriter, Double)
Writes the text representation of an 8-byte floating-point value to the text stream, without allocating a string.
Declaration
public static void WriteNoAlloc(this TextWriter writer, double value)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Double | value | The 8-byte floating-point value to write. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteNoAlloc(TextWriter, Double, ReadOnlySpan<Char>)
Writes the text representation of an 8-byte floating-point value to the text stream, without allocating a string.
Declaration
public static void WriteNoAlloc(this TextWriter writer, double value, ReadOnlySpan<char> format)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Double | value | The 8-byte floating-point value to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteNoAlloc(TextWriter, Double, ReadOnlySpan<Char>, Nullable<IFormatProvider>)
Writes the text representation of an 8-byte floating-point value to the text stream, without allocating a string.
Declaration
public static void WriteNoAlloc(this TextWriter writer, double value, ReadOnlySpan<char> format, IFormatProvider? formatProvider)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Double | value | The 8-byte floating-point value to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
System.Nullable<IFormatProvider> | formatProvider | An object that supplies culture-specific formatting information. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteNoAlloc(TextWriter, Int32)
Writes the text representation of a 4-byte signed integer to the text stream, without allocating a string.
Declaration
public static void WriteNoAlloc(this TextWriter writer, int value)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Int32 | value | The 4-byte signed integer to write. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteNoAlloc(TextWriter, Int32, ReadOnlySpan<Char>)
Writes the text representation of a 4-byte signed integer to the text stream, without allocating a string.
Declaration
public static void WriteNoAlloc(this TextWriter writer, int value, ReadOnlySpan<char> format)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Int32 | value | The 4-byte signed integer to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteNoAlloc(TextWriter, Int32, ReadOnlySpan<Char>, Nullable<IFormatProvider>)
Writes the text representation of a 4-byte signed integer to the text stream, without allocating a string.
Declaration
public static void WriteNoAlloc(this TextWriter writer, int value, ReadOnlySpan<char> format, IFormatProvider? formatProvider)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Int32 | value | The 4-byte signed integer to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
System.Nullable<IFormatProvider> | formatProvider | An object that supplies culture-specific formatting information. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteNoAlloc(TextWriter, Int64)
Writes the text representation of an 8-byte signed integer to the text stream, without allocating a string.
Declaration
public static void WriteNoAlloc(this TextWriter writer, long value)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Int64 | value | The 8-byte signed integer to write. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteNoAlloc(TextWriter, Int64, ReadOnlySpan<Char>)
Writes the text representation of an 8-byte signed integer to the text stream, without allocating a string.
Declaration
public static void WriteNoAlloc(this TextWriter writer, long value, ReadOnlySpan<char> format)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Int64 | value | The 8-byte signed integer to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteNoAlloc(TextWriter, Int64, ReadOnlySpan<Char>, Nullable<IFormatProvider>)
Writes the text representation of an 8-byte signed integer to the text stream, without allocating a string.
Declaration
public static void WriteNoAlloc(this TextWriter writer, long value, ReadOnlySpan<char> format, IFormatProvider? formatProvider)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Int64 | value | The 8-byte signed integer to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
System.Nullable<IFormatProvider> | formatProvider | An object that supplies culture-specific formatting information. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteNoAlloc(TextWriter, Single)
Writes the text representation of a 4-byte floating-point value to the text stream, without allocating a string.
Declaration
public static void WriteNoAlloc(this TextWriter writer, float value)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Single | value | The 4-byte floating-point value to write. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteNoAlloc(TextWriter, Single, ReadOnlySpan<Char>)
Writes the text representation of a 4-byte floating-point value to the text stream, without allocating a string.
Declaration
public static void WriteNoAlloc(this TextWriter writer, float value, ReadOnlySpan<char> format)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Single | value | The 4-byte floating-point value to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteNoAlloc(TextWriter, Single, ReadOnlySpan<Char>, Nullable<IFormatProvider>)
Writes the text representation of a 4-byte floating-point value to the text stream, without allocating a string.
Declaration
public static void WriteNoAlloc(this TextWriter writer, float value, ReadOnlySpan<char> format, IFormatProvider? formatProvider)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.Single | value | The 4-byte floating-point value to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
System.Nullable<IFormatProvider> | formatProvider | An object that supplies culture-specific formatting information. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteNoAlloc(TextWriter, UInt32)
Writes the text representation of a 4-byte unsigned integer to the text stream, without allocating a string.
Declaration
public static void WriteNoAlloc(this TextWriter writer, uint value)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.UInt32 | value | The 4-byte unsigned integer to write. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteNoAlloc(TextWriter, UInt32, ReadOnlySpan<Char>)
Writes the text representation of a 4-byte unsigned integer to the text stream, without allocating a string.
Declaration
public static void WriteNoAlloc(this TextWriter writer, uint value, ReadOnlySpan<char> format)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.UInt32 | value | The 4-byte unsigned integer to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteNoAlloc(TextWriter, UInt32, ReadOnlySpan<Char>, Nullable<IFormatProvider>)
Writes the text representation of a 4-byte unsigned integer to the text stream, without allocating a string.
Declaration
public static void WriteNoAlloc(this TextWriter writer, uint value, ReadOnlySpan<char> format, IFormatProvider? formatProvider)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.UInt32 | value | The 4-byte unsigned integer to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
System.Nullable<IFormatProvider> | formatProvider | An object that supplies culture-specific formatting information. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteNoAlloc(TextWriter, UInt64)
Writes the text representation of an 8-byte unsigned integer to the text stream, without allocating a string.
Declaration
public static void WriteNoAlloc(this TextWriter writer, ulong value)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.UInt64 | value | The 8-byte unsigned integer to write. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteNoAlloc(TextWriter, UInt64, ReadOnlySpan<Char>)
Writes the text representation of an 8-byte signed integer to the text stream, without allocating a string.
Declaration
public static void WriteNoAlloc(this TextWriter writer, ulong value, ReadOnlySpan<char> format)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.UInt64 | value | The 8-byte unsigned integer to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.
WriteNoAlloc(TextWriter, UInt64, ReadOnlySpan<Char>, Nullable<IFormatProvider>)
Writes the text representation of an 8-byte signed integer to the text stream, without allocating a string.
Declaration
public static void WriteNoAlloc(this TextWriter writer, ulong value, ReadOnlySpan<char> format, IFormatProvider? formatProvider)
Parameters
Type | Name | Description |
---|---|---|
TextWriter | writer | The |
System.UInt64 | value | The 8-byte unsigned integer to write. |
ReadOnlySpan<System.Char> | format | A standard or custom numeric format string. |
System.Nullable<IFormatProvider> | formatProvider | An object that supplies culture-specific formatting information. |
Remarks
This method may still allocate if the integer is too large to fit in a stack-allocated buffer.