commonMain.com.arkivanov.mvikotlin.timetravel.proto.internal.io.DataReader.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mvikotlin-timetravel-proto-internal Show documentation
Show all versions of mvikotlin-timetravel-proto-internal Show documentation
Kotlin Multiplatform MVI framework
package com.arkivanov.mvikotlin.timetravel.proto.internal.io
internal class DataReader(
private val data: ByteArray
) {
private var index = 0
fun readByte(): Byte = data[index++]
fun read(array: ByteArray, startIndex: Int = 0, endIndex: Int = array.size) {
data.copyInto(destination = array, destinationOffset = startIndex, startIndex = index, endIndex = index + endIndex - startIndex)
index += endIndex - startIndex
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy