public int ExportToWkb(byte[] buffer, wkbByteOrder byte_order) { int retval; long size = WkbSize(); if (size > Int32.MaxValue) { throw new ArgumentException("Too big geometry (ExportToWkb)"); } if (buffer.Length < size) { throw new ArgumentException("Buffer size is small (ExportToWkb)"); } IntPtr ptr = Marshal.AllocHGlobal((int)size * Marshal.SizeOf(buffer[0])); try { retval = ExportToWkb((int)size, ptr, byte_order); Marshal.Copy(ptr, buffer, 0, (int)size); } finally { Marshal.FreeHGlobal(ptr); } GC.KeepAlive(this); return(retval); }
public int ExportToWkb(int bufLen, IntPtr buffer, wkbByteOrder byte_order) { int ret = OgrPINVOKE.Geometry_ExportToWkb(swigCPtr, bufLen, buffer, (int)byte_order); if (OgrPINVOKE.SWIGPendingException.Pending) { throw OgrPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public int ExportToWkb( byte[] buffer, wkbByteOrder byte_order ) { int retval; int size = WkbSize(); if (buffer.Length < size) throw new ArgumentException("Buffer size is small (ExportToWkb)"); IntPtr ptr = Marshal.AllocHGlobal(size * Marshal.SizeOf(buffer[0])); try { retval = ExportToWkb(size, ptr, byte_order); Marshal.Copy(ptr, buffer, 0, size); } finally { Marshal.FreeHGlobal(ptr); } GC.KeepAlive(this); return retval; }
public int ExportToWkb(int bufLen, IntPtr buffer, wkbByteOrder byte_order) { int ret = OgrPINVOKE.Geometry_ExportToWkb(swigCPtr, bufLen, buffer, (int)byte_order); if (OgrPINVOKE.SWIGPendingException.Pending) throw OgrPINVOKE.SWIGPendingException.Retrieve(); return ret; }