Show / Hide Table of Contents

Class ChunkSequence

Represents extension methods for ChunkSequence<T>.

Inheritance
Object
ChunkSequence
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
[Obsolete("Use BufferHelpers class instead", true)]
public static class ChunkSequence

Methods

| Improve this Doc View Source

Concat<T>(Memory<T>, Memory<T>)

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

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

The first memory block.

Memory<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

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

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

Declaration
public static ReadOnlySequence<T> Concat<T>(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

CopyToAsync(ChunkSequence<Byte>, Stream, CancellationToken)

Copies chunks of bytes into the stream.

Declaration
public static ValueTask CopyToAsync(ChunkSequence<byte> sequence, Stream output, CancellationToken token = default(CancellationToken))
Parameters
Type Name Description
ChunkSequence<Byte> sequence

The sequence of chunks.

Stream output

The output stream.

CancellationToken token

The token that can be used to cancel execution of this method.

Returns
Type Description
ValueTask

The task representing asynchronouos execution of this method.

| Improve this Doc View Source

CopyToAsync(ChunkSequence<Char>, TextWriter, CancellationToken)

Copies chunks of bytes into the text writer.

Declaration
public static ValueTask CopyToAsync(ChunkSequence<char> sequence, TextWriter output, CancellationToken token = default(CancellationToken))
Parameters
Type Name Description
ChunkSequence<Char> sequence

The sequence of chunks.

TextWriter output

The text writer.

CancellationToken token

The token that can be used to cancel execution of this method.

Returns
Type Description
ValueTask

The task representing asynchronouos execution of this method.

| Improve this Doc View Source

ToReadOnlySequence<T>(IEnumerable<Memory<T>>)

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

Declaration
public static ReadOnlySequence<T> ToReadOnlySequence<T>(IEnumerable<Memory<T>> chunks)
Parameters
Type Name Description
IEnumerable<Memory<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

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

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

Declaration
public static ReadOnlySequence<T> ToReadOnlySequence<T>(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
In This Article
Back to top Generated by DocFX