All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.arkivanov.mvikotlin.timetravel.proto.internal.io.DataReader.kt Maven / Gradle / Ivy

There is a newer version: 4.2.0
Show newest version
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