strncpy method
Implementation
void strncpy(MemoryPointer dest, MemoryPointer src, int n) {
final srcLen = strlen(src);
final copyLen = srcLen < n ? srcLen + 1 : n; // include NUL only if it fits
dest.copyBytesFrom(src, copyLen);
if (copyLen < n) dest.fillBytes(0, n - copyLen, copyLen); // pad rest with NUL
}