Show / Hide Table of Contents

Class SpanWriter

Represents extension methods for SpanWriter<T> type.

Inheritance
Object
SpanWriter
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: DotNext.Buffers
Assembly: DotNext.dll
Syntax
public static class SpanWriter

Methods

| Improve this Doc View Source

TryWrite<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 value bytes.

Type Parameters
Name Description
T

The blittable type.

| Improve this Doc View Source

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 value bytes.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX