Show / Hide Table of Contents

Class BufferHelpers

Represents helper methods to work with various buffer representations.

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

Methods

| Improve this Doc View Source

BuildString(IGrowableBuffer<Char>)

Constructs the string from the buffer.

Declaration
public static string BuildString(this IGrowableBuffer<char> writer)
Parameters
Type Name Description
IGrowableBuffer<Char> writer

The buffer of characters.

Returns
Type Description
String

The string constructed from the buffer.

| Improve this Doc View Source

BuildString(ArrayBufferWriter<Char>)

Constructs the string from the buffer.

Declaration
public static string BuildString(this ArrayBufferWriter<char> writer)
Parameters
Type Name Description
ArrayBufferWriter<Char> writer

The buffer of characters.

Returns
Type Description
String

The string constructed from the buffer.

| Improve this Doc View Source

BuildString(ReadOnlySequence<Char>)

Constructs the string from non-contiguous buffer.

Declaration
public static string BuildString(this in ReadOnlySequence<char> sequence)
Parameters
Type Name Description
ReadOnlySequence<Char> sequence

The sequence of characters.

Returns
Type Description
String

The string constucted from the characters containing in the buffer.

| Improve this Doc View Source

Concat<T>(ReadOnlyMemory<T>, ReadOnlyMemory<T>)

Converts two memory blocks to ReadOnlySequence<T> data type.

Declaration
public static ReadOnlySequence<T> Concat<T>(this ReadOnlyMemory<T> first, ReadOnlyMemory<T> second)
Parameters
Type Name Description
ReadOnlyMemory<T> first

The first memory block.

ReadOnlyMemory<T> second

The second memory block.

Returns
Type Description
ReadOnlySequence<T>

The constructed ReadOnlySequence<T> instance containing memory blocks.

Type Parameters
Name Description
T

The type of elements in the memory blocks.

| Improve this Doc View Source

ToReadOnlySequence<T>(IEnumerable<ReadOnlyMemory<T>>)

Converts the sequence of memory blocks to ReadOnlySequence<T> data type.

Declaration
public static ReadOnlySequence<T> ToReadOnlySequence<T>(this IEnumerable<ReadOnlyMemory<T>> chunks)
Parameters
Type Name Description
IEnumerable<ReadOnlyMemory<T>> chunks

The sequence of memory blocks.

Returns
Type Description
ReadOnlySequence<T>

The constructed ReadOnlySequence<T> instance containing memory blocks.

Type Parameters
Name Description
T

The type of elements in the memory blocks.

| Improve this Doc View Source

Write<T>(IBufferWriter<T>, T)

Writes single element to the buffer.

Declaration
public static void Write<T>(this 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.

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