https://kotlinlang.org logo
#squarelibraries
Title
# squarelibraries
j

jw

11/10/2020, 2:52 AM
reading is more complicated
Copy code
val bufferedSource = source().buffer()
val cipher = try {
  val ivSize = bufferedSource.readInt()
  val iv = bufferedSource.readByteArray(ivSize.toLong())
  getDecryptionCipher(iv)
} catch (e: IOException) {
  try {
    bufferedSource.close()
  } catch (inner: IOException) {
    e.addSuppressed(inner)
  }
  throw e
}
return bufferedSource.cipherSource(cipher)
c

chris-horner

11/10/2020, 2:55 AM
Cheers Jake! 🍻
4 Views