LibCurl.Curl.internal_OnWriteCallback C# (CSharp) Метод

internal_OnWriteCallback() приватный Метод

private internal_OnWriteCallback ( IntPtr ptrBuffer, int sz, int nmemb, IntPtr ptrUserdata ) : int
ptrBuffer IntPtr
sz int
nmemb int
ptrUserdata IntPtr
Результат int
        int internal_OnWriteCallback(IntPtr ptrBuffer, int sz, int nmemb, IntPtr ptrUserdata)
        {
            if (_OnWriteCallback != null)
            {
                int bytes = sz * nmemb;
                byte[] b = new byte[bytes];
                Marshal.Copy(ptrBuffer, b, 0, bytes);

                object userdata = GetObject(ptrUserdata);
                return _OnWriteCallback(b, bytes, userdata);
            }
            return 0;
        }