Show / Hide Table of Contents

Class SpanReader

Represents extension methods for SpanReader<T> type.

Inheritance
Object
SpanReader
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 SpanReader

Methods

| Improve this Doc View Source

Read<T>(ref SpanReader<Byte>)

Reads the value of blittable type from the raw bytes represents by memory block.

Declaration
public static T Read<T>(this ref SpanReader<byte> reader)

    where T : struct
Parameters
Type Name Description
SpanReader<Byte> reader

The memory reader.

Returns
Type Description
T

The value deserialized from bytes.

Type Parameters
Name Description
T

The blittable type.

Exceptions
Type Condition
EndOfStreamException

The end of memory block is reached.

| Improve this Doc View Source

TryRead<T>(ref SpanReader<Byte>, out T)

Reads the value of blittable type from the raw bytes represents by memory block.

Declaration
public static bool TryRead<T>(this ref SpanReader<byte> reader, out T result)

    where T : struct
Parameters
Type Name Description
SpanReader<Byte> reader

The memory reader.

T result

The value deserialized from bytes.

Returns
Type Description
Boolean

true if memory block contains enough amount of unread bytes to decode the value; otherwise, false.

Type Parameters
Name Description
T

The blittable type.

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