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

com.wavesenterprise.serialization.AssetIdUtils.scala Maven / Gradle / Ivy

There is a newer version: 1.16.0
Show newest version
package com.wavesenterprise.serialization

import com.google.common.io.ByteArrayDataOutput
import com.wavesenterprise.state.ByteStr
import com.wavesenterprise.transaction.{AssetId, AssetIdLength}

object AssetIdUtils {
  def assetIdWriter(value: AssetId, output: ByteArrayDataOutput): Unit = {
    output.write(value.arr)
  }

  def assetIdReader(bytes: Array[Byte], pos: Int): (AssetId, Int) = {
    val (result, resultEnd) = ByteStr(bytes.slice(pos, pos + AssetIdLength)) -> (pos + AssetIdLength)
    result -> resultEnd
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy