Table of Contents

Class ArrayBufferProvider<T>

Namespace
ReFuel.Resources
Assembly
ReFuel.dll

A buffer provider for basic array types.

public class ArrayBufferProvider<T> : IResizeableBuffer, IBufferProvider, IDisposable where T : struct

Type Parameters

T

The array buffer type.

Inheritance
ArrayBufferProvider<T>
Implements
Inherited Members

Constructors

ArrayBufferProvider(T[])

public ArrayBufferProvider(T[] array)

Parameters

array T[]

Properties

IsReadOnly

True if the buffer is read only.

public bool IsReadOnly { get; }

Property Value

bool

Size

Size of the buffer in bytes.

public int Size { get; }

Property Value

int

Methods

Acquire(bool, TimeSpan?)

Acquire a lock to this buffer provider.

public BufferLock Acquire(bool isReadonly = true, TimeSpan? timeout = null)

Parameters

isReadonly bool

True for a readonly lock.

timeout TimeSpan?

Lock acquire time out.

Returns

BufferLock

The lock instance if successfull.

AsSpan()

public ReadOnlySpan<byte> AsSpan()

Returns

ReadOnlySpan<byte>

AsWriteSpan()

public Span<byte> AsWriteSpan()

Returns

Span<byte>

Clone(IBufferProvider)

public static ArrayBufferProvider<T> Clone(IBufferProvider provider)

Parameters

provider IBufferProvider

Returns

ArrayBufferProvider<T>

CopyTo(IBufferProvider, TimeSpan?)

Copy this buffer contents to another buffer.

public void CopyTo(IBufferProvider destination, TimeSpan? timeout = null)

Parameters

destination IBufferProvider

The destination buffer.

timeout TimeSpan?

Lock acquire time out.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Resize(int)

public void Resize(int newSize)

Parameters

newSize int

TryAcquire(out BufferLock, bool, TimeSpan?)

Try to acquire a lock to this buffer provider.

public bool TryAcquire(out BufferLock @lock, bool isReadonly = true, TimeSpan? timeout = null)

Parameters

lock BufferLock

The lock object, when true.

isReadonly bool

True if for a readonly lock.

timeout TimeSpan?

Lock acquire time out.

Returns

bool

True if the lock was acquired.