Show / Hide Table of Contents

Method FastBuffer<T>.Write(+ 2 overloads)


Overload

Copies data to the buffer at FastBuffer<T>.Position. Resizes the buffer if need.

public void Write<TElem>(ReadOnlySpan<TElem> data, bool andLength = false) where TElem : unmanaged
Parameters
data  (ReadOnlySpan<TElem>)
andLength  (bool)

At first write data.Length as int.

Exceptions
InvalidOperationException

The generic type of this is not byte.

Type Parameters
TElem

Remarks

The generic type of this must be byte.

Finally sets FastBuffer<T>.Position = the end of the requested data.


Overload(next)

Copies data to the buffer at FastBuffer<T>.Position. Resizes the buffer if need.

public void Write<TData>(in TData data) where TData : unmanaged
Parameters
data  (TData)
Exceptions
InvalidOperationException

The generic type of this is not byte.

Type Parameters
TData

Remarks

The generic type of this must be byte.

Finally sets FastBuffer<T>.Position = the end of the requested data.


Overload(top)

Copies data to the buffer at FastBuffer<T>.Position. Resizes the buffer if need.

public void Write(string data, bool andLength = false)
Parameters
data  (string)
andLength  (bool)

At first write data.Length as int.

Exceptions
InvalidOperationException

The generic type of this is not byte.

Remarks

The generic type of this must be byte.

Finally sets FastBuffer<T>.Position = the end of the requested data.