NanoByte.Common  2.10.5
NanoByte.Common.Collections.ArrayBuffer< T > Class Template Reference

An array rented from the ArrayPool<T>. More...

Inheritance diagram for NanoByte.Common.Collections.ArrayBuffer< T >:

Public Member Functions

 ArrayBuffer (int length)
 Rents an array from the ArrayPool<T>. More...
 
void Dispose ()
 Returns the array to the ArrayPool<T>. More...
 

Properties

int Length [get]
 The requested length of the array. More...
 
T[] Array [get]
 The array. The length may be equal to or greater than the requested Length. More...
 
ArraySegment< T > Segment [get]
 A view of the array with exactly the requested Length. More...
 
Span< T > Span [get]
 A view of the array with exactly the requested Length. More...
 

Detailed Description

An array rented from the ArrayPool<T>.

Constructor & Destructor Documentation

◆ ArrayBuffer()

Rents an array from the ArrayPool<T>.

Parameters
lengthThe desired array length.

Member Function Documentation

◆ Dispose()

void NanoByte.Common.Collections.ArrayBuffer< T >.Dispose ( )
inline

Returns the array to the ArrayPool<T>.

Property Documentation

◆ Array

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

Exceptions
ObjectDisposedExceptionDispose has been called.

◆ Length

The requested length of the array.

◆ Segment

ArraySegment<T> NanoByte.Common.Collections.ArrayBuffer< T >.Segment
get

A view of the array with exactly the requested Length.

Exceptions
ObjectDisposedExceptionDispose has been called.

◆ Span

A view of the array with exactly the requested Length.

Exceptions
ObjectDisposedExceptionDispose has been called.

The documentation for this class was generated from the following file: