Fix crash when skipping in BetterCipherInputStream.

This commit is contained in:
Greyson Parrelli
2025-07-01 08:42:39 -04:00
parent 516b505059
commit 939f2f82b1
2 changed files with 26 additions and 15 deletions

View File

@@ -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