Show buffer copy

This commit is contained in:
J-Jamet
2021-02-06 20:57:28 +01:00
parent d13aa047d5
commit 2f15d6c9f2
3 changed files with 27 additions and 13 deletions

View File

@@ -400,9 +400,9 @@ class AttachmentFileNotificationService: LockNotificationService() {
var dataUploaded = 0L
val fileSize = contentResolver.openFileDescriptor(attachmentFromDownloadUri, "r")?.statSize ?: 0
UriUtil.getUriInputStream(contentResolver, attachmentFromDownloadUri)?.let { inputStream ->
Database.getInstance().loadedCipherKey?.let { binaryCipherKey ->
BufferedInputStream(inputStream).use { attachmentBufferedInputStream ->
Database.getInstance().loadedCipherKey?.let { binaryCipherKey ->
binaryAttachment.getGzipOutputDataStream(binaryCipherKey).use { outputStream ->
BufferedInputStream(inputStream).use { attachmentBufferedInputStream ->
attachmentBufferedInputStream.readAllBytes(bufferSize) { buffer ->
outputStream.write(buffer)
dataUploaded += buffer.size