Class ArrayBuffer<T>
An array rented from the ArrayPool<T>.
Namespace: NanoByte.Common.Collections
Assembly: NanoByte.Common.dll
Syntax
public sealed class ArrayBuffer<T> : Object
Type Parameters
Name | Description |
---|---|
T |
Constructors
ArrayBuffer(Int32)
An array rented from the ArrayPool<T>.
Declaration
public ArrayBuffer(int length)
Parameters
Type | Name | Description |
---|---|---|
Int32 | length | The desired array length. |
Properties
Array
The array. The length may be equal to or greater than the requested Length.
Declaration
public T[] Array { get; }
Property Value
Type | Description |
---|---|
T[] |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | Dispose() has been called. |
Length
The requested length of the array.
Declaration
public int Length { get; }
Property Value
Type | Description |
---|---|
Int32 |
Segment
A view of the array with exactly the requested Length.
Declaration
public ArraySegment<T> Segment { get; }
Property Value
Type | Description |
---|---|
ArraySegment<T> |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | Dispose() has been called. |
Span
A view of the array with exactly the requested Length.
Declaration
public Span<T> Span { get; }
Property Value
Type | Description |
---|---|
Span<T> |
Exceptions
Type | Condition |
---|---|
ObjectDisposedException | Dispose() has been called. |
Methods
Dispose()
Returns the array to the ArrayPool<T>.
Declaration
public void Dispose()