Fix length and better streams implementation

This commit is contained in:
J-Jamet
2021-02-06 20:24:07 +01:00
parent 7590d18c67
commit d13aa047d5
7 changed files with 64 additions and 38 deletions

View File

@@ -373,7 +373,7 @@ class AttachmentFileNotificationService: LockNotificationService() {
bufferSize: Int = DEFAULT_BUFFER_SIZE,
update: ((percent: Int)->Unit)? = null) {
var dataDownloaded = 0L
val fileSize = binaryAttachment.length()
val fileSize = binaryAttachment.length
UriUtil.getUriOutputStream(contentResolver, attachmentToUploadUri)?.use { outputStream ->
Database.getInstance().loadedCipherKey?.let { binaryCipherKey ->
binaryAttachment.getUnGzipInputDataStream(binaryCipherKey).use { inputStream ->