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

endless.scodec.ScodecEncoder.scala Maven / Gradle / Ivy

The newest version!
package endless.scodec

import endless.core.protocol.Encoder

class ScodecEncoder[-A](implicit encoder: scodec.Encoder[A]) extends Encoder[A] {
  override def encode(a: A): Array[Byte] = encoder.encode(a).require.toByteArray
}

object ScodecEncoder {
  implicit def apply[A: scodec.Encoder]: ScodecEncoder[A] = new ScodecEncoder[A]
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy