public static bool CopyAttrib(XndAttrib lh, XndAttrib rh) { if (lh.IsWritable == false) { return(false); } lh.BeginWrite(); var data = new byte[rh.Length]; rh.BeginRead(); unsafe { fixed(byte *ptr = &data[0]) { rh.Read((IntPtr)ptr, (int)data.Length); lh.Write((IntPtr)ptr, (int)data.Length); } } rh.EndRead(); lh.EndWrite(); return(true); }