Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Equivalent of initWithBytes of NSData Class

$
0
0

Hi I have the below code in objective C and i stuck on converting the 'initWithBytes' line to c#.Tried to found equivalent of this in xamarin documentation but could not find it.

int serviceUUID, characteristicUUID

UInt16 s = [self swap:serviceUUID];
UInt16 c = [self swap:characteristicUUID]; 

NSData *sd = [[NSData alloc] initWithBytes:(char *)&s length:2];
NSData *cd = [[NSData alloc] initWithBytes:(char *)&c length:2];

CBUUID *su = [CBUUID UUIDWithData:sd];
CBUUID *cu = [CBUUID UUIDWithData:cd];

Any Help would be appreciable. Thanks


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>