mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Refactor and improve attachment deduping logic.
This commit is contained in:
committed by
Cody Henthorne
parent
b7ee6bfcb3
commit
6df1a68213
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user