public CMBlockBufferError AppendBuffer(CMBlockBuffer?targetBuffer, nuint offsetToData, nuint dataLength, CMBlockBufferFlags flags) { // From docs targetBuffer must not be null unless the PermitEmptyReference flag is set if (!flags.HasFlag(CMBlockBufferFlags.PermitEmptyReference)) { if (targetBuffer is null) { ObjCRuntime.ThrowHelper.ThrowArgumentNullException(nameof(targetBuffer)); } } return(CMBlockBufferAppendBufferReference(GetCheckedHandle(), targetBuffer.GetHandle(), offsetToData, dataLength, flags)); }
public CMBlockBufferError AppendBuffer(CMBlockBuffer targetBuffer, nuint offsetToData, nuint dataLength, CMBlockBufferFlags flags) { if (Handle == IntPtr.Zero) { throw new ObjectDisposedException("BlockBuffer"); } // From docs targetBuffer must not be null unless the PermitEmptyReference flag is set if (!flags.HasFlag(CMBlockBufferFlags.PermitEmptyReference)) { if (targetBuffer == null) { throw new ArgumentNullException("targetBuffer"); } } return(CMBlockBufferAppendBufferReference(Handle, targetBuffer == null ? IntPtr.Zero : targetBuffer.handle, offsetToData, dataLength, flags)); }
public static CMBlockBuffer FromBuffer(CMBlockBuffer targetBuffer, nuint offsetToData, nuint dataLength, CMBlockBufferFlags flags, out CMBlockBufferError error) { // From docs targetBuffer must not be null unless the PermitEmptyReference flag is set if (!flags.HasFlag(CMBlockBufferFlags.PermitEmptyReference)) { if (targetBuffer == null) { throw new ArgumentNullException("targetBuffer"); } } IntPtr buffer; error = CMBlockBufferCreateWithBufferReference(IntPtr.Zero, targetBuffer == null ? IntPtr.Zero : targetBuffer.handle, offsetToData, dataLength, flags, out buffer); if (error != CMBlockBufferError.None) { return(null); } return(new CMBlockBuffer(buffer, true)); }
public static CMBlockBuffer?FromBuffer(CMBlockBuffer?targetBuffer, nuint offsetToData, nuint dataLength, CMBlockBufferFlags flags, out CMBlockBufferError error) { // From docs targetBuffer must not be null unless the PermitEmptyReference flag is set if (!flags.HasFlag(CMBlockBufferFlags.PermitEmptyReference)) { if (targetBuffer is null) { ObjCRuntime.ThrowHelper.ThrowArgumentNullException(nameof(targetBuffer)); } } IntPtr buffer; error = CMBlockBufferCreateWithBufferReference(IntPtr.Zero, targetBuffer.GetHandle(), offsetToData, dataLength, flags, out buffer); if (error != CMBlockBufferError.None) { return(null); } return(new CMBlockBuffer(buffer, true)); }
public CMBlockBufferError AppendBuffer(CMBlockBuffer targetBuffer, nuint offsetToData, nuint dataLength, CMBlockBufferFlags flags) { if (Handle == IntPtr.Zero) throw new ObjectDisposedException ("BlockBuffer"); // From docs targetBuffer must not be null unless the PermitEmptyReference flag is set if (!flags.HasFlag (CMBlockBufferFlags.PermitEmptyReference)) { if (targetBuffer == null) throw new ArgumentNullException ("targetBuffer"); } return CMBlockBufferAppendBufferReference (Handle, targetBuffer == null ? IntPtr.Zero : targetBuffer.handle, offsetToData, dataLength, flags); }
public static CMBlockBuffer FromBuffer(CMBlockBuffer targetBuffer, nuint offsetToData, nuint dataLength, CMBlockBufferFlags flags, out CMBlockBufferError error) { // From docs targetBuffer must not be null unless the PermitEmptyReference flag is set if (!flags.HasFlag (CMBlockBufferFlags.PermitEmptyReference)) if (targetBuffer == null) throw new ArgumentNullException ("targetBuffer"); IntPtr buffer; error = CMBlockBufferCreateWithBufferReference (IntPtr.Zero, targetBuffer == null ? IntPtr.Zero : targetBuffer.handle, offsetToData, dataLength, flags, out buffer); if (error != CMBlockBufferError.None) return null; return new CMBlockBuffer (buffer, true); }