NybbleArray

class NybbleArray(val bytes: ByteArray, val size: Int) : Iterable<Byte>

A NybbleArray offers dense storage of nybbles, i.e., values in 0,15. Even indices correspond to low nybbles of bytes, whereas odd indices correspond to high nybbles of bytes.

Author

Todd L Smith

Constructors

Link copied to clipboard
fun NybbleArray(bytes: ByteArray, size: Int)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open fun forEach(p0: Consumer<in Byte>)
Link copied to clipboard
operator fun get(index: Int): Byte

Answer the nybble at the given zero-based index.

Link copied to clipboard
fun inputStream(index: Int = 0): NybbleInputStream

Answer a NybbleInputStream positioned at the specified index.

Link copied to clipboard
fun isEmpty(): Boolean

Determine whether the receiver is empty.

Link copied to clipboard
fun isNotEmpty(): Boolean

Determine whether the receiver is nonempty.

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

Answer an iterator over the nybbles in the receiver.

Link copied to clipboard
operator fun set(index: Int, value: Byte)

Sets the nybble at the given index to the given value.

Link copied to clipboard
open fun spliterator(): Spliterator<Byte>
Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
val bytes: ByteArray

The underlying ByteArray that supports primitive data storage.

Link copied to clipboard
val size: Int

The number of nybbles available, corresponding to the first size nybbles of bytes.