NativeBuffer constructor

NativeBuffer(
  1. int capacity
)

Allocates capacity bytes of native memory.

Implementation

NativeBuffer(int capacity) : _handle = b.wt_buffer_new(capacity) {
  if (_handle == nullptr) {
    throw WebTransportException(
      b.wt_status_t.WT_ERR_IO.value,
      'could not allocate $capacity bytes',
      operation: 'wt_buffer_new',
    );
  }
}