close FileInputStreams to prevent resource leak
This commit is contained in:
+1
-1
@@ -73,7 +73,7 @@ abstract class OpCrypto internal constructor() : OpUnary() {
|
||||
}
|
||||
|
||||
@Throws(IOException::class, NoSuchAlgorithmException::class)
|
||||
fun hashFd(file: File?): ByteArray = hashFd(FileInputStream(file))
|
||||
fun hashFd(file: File?): ByteArray = FileInputStream(file).use { inputStream -> hashFd(inputStream) }
|
||||
|
||||
@Throws(IOException::class, NoSuchAlgorithmException::class)
|
||||
fun hashFd(bytes: ByteArray): ByteArray {
|
||||
|
||||
Reference in New Issue
Block a user