reading is more complicated ```val bufferedSource ...
# squarelibraries
j
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
Cheers Jake! 🍻