Table of Contents

Class ArrayBuffer<T>

Namespace
NanoByte.Common.Collections
Assembly
NanoByte.Common.dll

An array rented from the ArrayPool<T>.

public sealed class ArrayBuffer<T>

Type Parameters

T
Inheritance
ArrayBuffer<T>
Extension Methods

Constructors

ArrayBuffer(int)

An array rented from the ArrayPool<T>.

public ArrayBuffer(int length)

Parameters

length int

The desired array length.

Properties

Array

The array. The length may be equal to or greater than the requested Length.

public T[] Array { get; }

Property Value

T[]

Exceptions

ObjectDisposedException

Dispose() has been called.

Length

The requested length of the array.

public int Length { get; }

Property Value

int

Segment

A view of the array with exactly the requested Length.

public ArraySegment<T> Segment { get; }

Property Value

ArraySegment<T>

Exceptions

ObjectDisposedException

Dispose() has been called.

Span

A view of the array with exactly the requested Length.

public Span<T> Span { get; }

Property Value

Span<T>

Exceptions

ObjectDisposedException

Dispose() has been called.

Methods

Dispose()

Returns the array to the ArrayPool<T>.

public void Dispose()