mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-26 19:56:02 +01:00
Fix crash when skipping in BetterCipherInputStream.
This commit is contained in:
@@ -58,21 +58,6 @@ class BetterCipherInputStream(
|
||||
|
||||
override fun markSupported(): Boolean = false
|
||||
|
||||
@Throws(IOException::class)
|
||||
override fun skip(byteCount: Long): Long {
|
||||
val buffer = ByteArray(4096)
|
||||
var skipped = 0L
|
||||
|
||||
while (skipped < byteCount) {
|
||||
val remaining = byteCount - skipped
|
||||
val read = read(buffer, 0, remaining.toInt())
|
||||
|
||||
skipped += read.toLong()
|
||||
}
|
||||
|
||||
return skipped
|
||||
}
|
||||
|
||||
@Throws(IOException::class)
|
||||
private fun readIncremental(outputBuffer: ByteArray, originalOffset: Int, originalLength: Int): Int {
|
||||
var offset = originalOffset
|
||||
|
||||
Reference in New Issue
Block a user