private static void FillBuffer(IntPtr handle, byte[] buffer, uint width, uint height, ColorSpace colorSpace) { Debug.Assert(handle != IntPtr.Zero); if (buffer == null) { throw new ArgumentNullException(nameof(buffer)); } if (buffer.Length == 0) { throw new ArgumentException("Buffer.Length is zero.", nameof(buffer)); } ValidationUtil.ValidateEnum(typeof(ColorSpace), colorSpace, nameof(colorSpace)); InteropSource.FillBuffer(handle, buffer, buffer.Length, width, height, colorSpace.ToVisionColorSpace()). Validate("Failed to fill buffer"); }