mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-05 05:35:07 +01:00
Close InputStream
after usage in KeyReader
The `InputStream` would not be closed after reading the key file in `KeyReader#import`, it's now wrapped with `use{ }` which handles closing the stream after usage.
This commit is contained in:
parent
647cb07dc8
commit
1d070e6332
@ -47,7 +47,7 @@ object KeyReader {
|
||||
|
||||
val tmpOutputFile = File("${context.filesDir.canonicalFile}/${keyType.fileName}.tmp")
|
||||
|
||||
val inputStream = context.contentResolver.openInputStream(uri)
|
||||
context.contentResolver.openInputStream(uri).use { inputStream ->
|
||||
tmpOutputFile.bufferedWriter().use { writer ->
|
||||
val valid = inputStream!!.bufferedReader().useLines {
|
||||
for (line in it) {
|
||||
@ -83,6 +83,7 @@ object KeyReader {
|
||||
return valid
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun isHexString(str : String) : Boolean {
|
||||
for (c in str)
|
||||
|
Loading…
Reference in New Issue
Block a user