Class SpanWriter
Represents extension methods for SpanWriter<T> type.
Inherited Members
Namespace: DotNext.Buffers
Assembly: DotNext.dll
Syntax
public static class SpanWriter
Methods
| Improve this Doc View SourceTryWrite<T>(ref SpanWriter<Byte>, T)
Writes value of blittable type as bytes to the underlying memory block.
Declaration
public static bool TryWrite<T>(this ref SpanWriter<byte> writer, in T value)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
SpanWriter<Byte> | writer | The memory writer. |
T | value | The value of blittable type. |
Returns
Type | Description |
---|---|
Boolean | true if all bytes are copied successfully;
false if remaining space in the underlying span is not enough to place all |
Type Parameters
Name | Description |
---|---|
T | The blittable type. |
Write<T>(ref SpanWriter<Byte>, T)
Writes value of blittable type as bytes to the underlying memory block.
Declaration
public static void Write<T>(this ref SpanWriter<byte> writer, in T value)
where T : struct
Parameters
Type | Name | Description |
---|---|---|
SpanWriter<Byte> | writer | The memory writer. |
T | value | The value of blittable type. |
Type Parameters
Name | Description |
---|---|
T | The blittable type. |
Exceptions
Type | Condition |
---|---|
EndOfStreamException | Remaining space in the underlying span is not enough to place all |