initWithBytesNoCopy method

NSString? initWithBytesNoCopy(
  1. Pointer<Void> bytes, {
  2. required int length,
  3. required int encoding,
  4. ObjCBlock<Void Function(Pointer<Void>, UnsignedLong)>? deallocator,
})

initWithBytesNoCopy:length:encoding:deallocator:

Implementation

NSString? initWithBytesNoCopy(
  ffi.Pointer<ffi.Void> bytes, {
  required int length,
  required int encoding,
  objc.ObjCBlock<ffi.Void Function(ffi.Pointer<ffi.Void>, ffi.UnsignedLong)>?
  deallocator,
}) {
  final $ret = _objc_msgSend_1lbgrac(
    object$.ref.retainAndReturnPointer(),
    _sel_initWithBytesNoCopy_length_encoding_deallocator_,
    bytes,
    length,
    encoding,
    deallocator?.ref.pointer ?? ffi.nullptr,
  );
  return $ret.address == 0
      ? null
      : NSString.fromPointer($ret, retain: false, release: true);
}