Fix NullStream to make much more sense
This commit is contained in:
parent
aec126877b
commit
42846b6a44
1 changed files with 3 additions and 2 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue