Fix FileAccessStream#readNextByte
This commit is contained in:
parent
c277bf9e17
commit
64f7b5be54
1 changed files with 6 additions and 1 deletions
|
@ -102,7 +102,12 @@ class FileAccessStream internal constructor(val file: FileAccess) : Stream(strea
|
|||
.createFile()
|
||||
.verifyIsFile()
|
||||
|
||||
return inputStream.read().toByte()
|
||||
val byte: Int = inputStream.read()
|
||||
|
||||
return if (byte == -1)
|
||||
null
|
||||
else
|
||||
byte.toByte()
|
||||
} catch (_: VerificationFailedException) {
|
||||
throw IOAccessException("File '${file}' does not exist")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue