LSLReusableBuffer<T extends NativeType> constructor

LSLReusableBuffer<T extends NativeType>(
  1. int capacity,
  2. Pointer<T> buffer
)

Creates a reusable buffer of the given capacity. @param capacity The capacity of the buffer in number of elements. @param buffer The buffer to store the sample.

Implementation

LSLReusableBuffer(this.capacity, this.buffer) {
  if (buffer.isNullPointer && (this is! LSLReusableBufferVoid)) {
    throw ArgumentError('Error allocating buffer of type ${T.runtimeType}');
  }
}