Fix FileAccessStream#readNextByte
All checks were successful
PRs & Pushes / test (push) Successful in 3m35s
PRs & Pushes / build-apidoc (push) Successful in 4m2s
PRs & Pushes / build-jars (push) Successful in 4m4s

This commit is contained in:
JeremyStar™ 2025-01-12 14:41:49 +01:00
parent c277bf9e17
commit 64f7b5be54
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -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")
}