Copy Bits lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- Gilles · 2018-12-23 08:56 Hello I would like copying bits from a CFMutableDataRef to another. L_cnt bits starting in H_i at L_adi, to H_j starting in L_adj That's how I perform this :     procedure f_HBlockToHBlock (H_i, H_j: CFMutableDataRef; L_adi, L_adj, L_cnt: SInt32);         var             h_buf: CFMutableDataRef;             h_xx_buf: UnivPtr;     begin         h_buf := CFDataCrea]"]>Blockedtable(nil, L_cnt);         if h_buf <> nil then         begin             h_xx_buf := CFDataGetMutableBytePtr(h_buf);             CFDataGetBytes(H_i, CFRangeMake(L_adi, L_cnt), h_xx_buf);             CFDataReplaceBytes(H_j, CFRangeMake(L_adj, L_cnt), h_xx_buf, L_cnt);             CFRelease(h_buf)         end     end; Well… I'm sure there is a simpler way (whithout having to create h-buf) Any idea ? G.