NybbleInputStream

class NybbleInputStream(nybbles: NybbleArray, nybbleIndex: Int = 0) : InputStream, Iterable<Int>

NybbleInputStream reads from a NybbleArray.

Author

Todd L Smith

Parameters

nybbles

The NybbleArray that serves as the nybble source.

nybbleIndex

The zero-based index of the first nybble to read.

Constructors

Link copied to clipboard
constructor(nybbles: NybbleArray, nybbleIndex: Int = 0)

Properties

Link copied to clipboard

Whether the receiver is exhausted.

Link copied to clipboard

The read position.

Functions

Link copied to clipboard
open override fun available(): Int

The exact number of nybbles that can be read before reaching the end-of-stream. Reading never blocks.

Link copied to clipboard
open override fun close()
Link copied to clipboard
open fun forEach(p0: Consumer<in Int>)
Link copied to clipboard
fun goTo(index: Int)

Move the read position to the specified index.

Link copied to clipboard
open operator override fun iterator(): Iterator<Int>

Answer an iterator that consumes nybbles from the receiver.

Link copied to clipboard
inline fun <T, R> Iterable<T>.mapToSet(destination: MutableSet<R> = mutableSetOf(), transform: (T) -> R): MutableSet<R>

Transform the receiver via the supplied function and collect the results into an optionally provided set. Answer the result set.

Link copied to clipboard
open override fun mark(readLimit: Int)

Set the mark. The read limit is ignored; any number of nybbles may be read without invalidating reset.

Link copied to clipboard
open override fun markSupported(): Boolean

Mark is supported.

Link copied to clipboard

Unapply the variable-length universal coding strategy applied by opcode to decode a nonnegative integer from the receiver. If the stored encoding does not denote a valid value, the result is undefined, and the number of bytes consumed is also undefined.

Link copied to clipboard
open override fun read(): Int
open fun read(p0: ByteArray): Int
open fun read(p0: ByteArray, p1: Int, p2: Int): Int
Link copied to clipboard
Link copied to clipboard
open fun readNBytes(p0: Int): ByteArray
open fun readNBytes(p0: ByteArray, p1: Int, p2: Int): Int
Link copied to clipboard
open override fun reset()

Reset the read position to the previous mark. If mark was never called on the receiver, then reset the read position to the beginning of the stream.

Link copied to clipboard
open override fun skip(n: Long): Long
Link copied to clipboard
open fun skipNBytes(p0: Long)
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
Link copied to clipboard

Unapply the variable-length universal coding strategy applied by vlq to decode a nonnegative integer from the receiver. If the stored encoding does not denote a valid value, the result is undefined, and the number of bytes consumed is also undefined.