Fix NullStream to make much more sense

This commit is contained in:
JeremyStar™ 2024-12-25 21:27:08 +01:00
parent aec126877b
commit 42846b6a44
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -42,14 +42,15 @@ class NullStream private constructor() : Stream(streamMode = StreamMode.READ_WRI
val instance: NullStream = NullStream() val instance: NullStream = NullStream()
} }
override fun close() = Unit
override fun closeStream() = Unit override fun closeStream() = Unit
override fun writeByte(byte: Byte): Stream = this override fun writeByte(byte: Byte): Stream = this
override fun writeBytes(bytes: ByteArray): 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 available(): UInt = 0u
override fun readNextByte(): Byte = 0 override fun readNextByte(): Byte? = null
override fun readNBytes(n: UInt): ByteArray = byteArrayOf() override fun readNBytes(n: UInt): ByteArray = byteArrayOf()
override fun readRemainingBytes(): ByteArray = byteArrayOf() override fun readRemainingBytes(): ByteArray = byteArrayOf()
} }