From 42846b6a4477a5e112393892880c170eff37ff44 Mon Sep 17 00:00:00 2001 From: JeremyStarTM Date: Wed, 25 Dec 2024 21:27:08 +0100 Subject: [PATCH] Fix NullStream to make much more sense --- .../engine/base/implementation/stream/NullStream.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/base/src/main/kotlin/de/staropensource/engine/base/implementation/stream/NullStream.kt b/base/src/main/kotlin/de/staropensource/engine/base/implementation/stream/NullStream.kt index 52bfd06..05dccff 100644 --- a/base/src/main/kotlin/de/staropensource/engine/base/implementation/stream/NullStream.kt +++ b/base/src/main/kotlin/de/staropensource/engine/base/implementation/stream/NullStream.kt @@ -42,14 +42,15 @@ class NullStream private constructor() : Stream(streamMode = StreamMode.READ_WRI val instance: NullStream = NullStream() } + override fun close() = Unit override fun closeStream() = Unit override fun writeByte(byte: Byte): Stream = this override fun writeBytes(bytes: ByteArray): Stream = this - override fun remaining(): Boolean = true + override fun remaining(): Boolean = false override fun available(): UInt = 0u - override fun readNextByte(): Byte = 0 + override fun readNextByte(): Byte? = null override fun readNBytes(n: UInt): ByteArray = byteArrayOf() override fun readRemainingBytes(): ByteArray = byteArrayOf() }