示例#1
0
 public void Dispose()
 {
     if (_partUpload != null)
     {
         _partUpload.Dispose();
         _partUpload = null;
     }
 }
示例#2
0
        private unsafe uint DoUnsafeUpload(SWIG.UplinkPartUpload partUpload, string objectKey, byte[] partBytes)
        {
            fixed(byte *arrayPtr = partBytes)
            {
                using (SWIG.UplinkWriteResult sentResult = SWIG.storj_uplink.uplink_part_upload_write(partUpload, new SWIG.SWIGTYPE_p_void(new IntPtr(arrayPtr), true), (uint)partBytes.Length))
                {
                    if (sentResult.error != null && !string.IsNullOrEmpty(sentResult.error.message))
                    {
                        throw new MultipartUploadFailedException(objectKey, sentResult.error.message);
                    }

                    using (var commitResult = SWIG.storj_uplink.uplink_part_upload_commit(partUpload))
                    {
                        if (commitResult != null && !string.IsNullOrEmpty(commitResult.message))
                        {
                            throw new MultipartUploadFailedException(objectKey, commitResult.message);
                        }

                        return(sentResult.bytes_written);
                    }
                }
            }
        }
示例#3
0
 internal PartUploadResult(SWIG.UplinkPartUpload partUpload)
 {
     PartUpload = new PartUpload(partUpload);
 }
示例#4
0
 internal PartUpload(SWIG.UplinkPartUpload partUpload)
 {
     _partUpload = partUpload;
 }