mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Change length binary method
This commit is contained in:
@@ -36,9 +36,7 @@ class BinaryAttachment : Parcelable {
|
|||||||
private var dataFile: File? = null
|
private var dataFile: File? = null
|
||||||
|
|
||||||
fun length(): Long {
|
fun length(): Long {
|
||||||
if (dataFile != null)
|
return dataFile?.length() ?: 0
|
||||||
return dataFile!!.length()
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -65,7 +63,7 @@ class BinaryAttachment : Parcelable {
|
|||||||
@Throws(IOException::class)
|
@Throws(IOException::class)
|
||||||
fun getInputDataStream(): InputStream {
|
fun getInputDataStream(): InputStream {
|
||||||
return when {
|
return when {
|
||||||
dataFile != null -> FileInputStream(dataFile!!)
|
length() > 0 -> FileInputStream(dataFile!!)
|
||||||
else -> ByteArrayInputStream(ByteArray(0))
|
else -> ByteArrayInputStream(ByteArray(0))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user