Refactor and improve attachment deduping logic.

This commit is contained in:
Greyson Parrelli
2024-03-12 13:38:16 -04:00
committed by Cody Henthorne
parent b7ee6bfcb3
commit 6df1a68213
16 changed files with 1150 additions and 565 deletions

View File

@@ -7,7 +7,6 @@ package org.signal.core.util
import java.io.IOException
import java.io.InputStream
import kotlin.jvm.Throws
/**
* Reads a 32-bit variable-length integer from the stream.
@@ -80,3 +79,11 @@ fun InputStream.readLength(): Long {
return count
}
/**
* Reads the contents of the stream and discards them.
*/
@Throws(IOException::class)
fun InputStream.drain() {
this.readLength()
}