I am using avro4s
https://github.com/sksamuel/avro4s
I wrote this code
import java.io.ByteArrayOutputStream
import com.sksamuel.avro4s._
sealed trait Dibble
case class Dobble(str: String) extends Dibble
case class Dabble(dbl: Double) extends Dibble
case class Drapper(dibble: Dibble)
val drapperIn = Drapper(Dabble(2.0))
val bios = new ByteArrayOutputStream
val avro = AvroOutputStream.binary[Drapper](bios)
avro.write(drapperIn)
avro.close()
val is = AvroInputStream.binary[Drapper](bios.toByteArray)
val drapperOut = is.iterator().toList.head
is.close()
println(drapperIn == drapperOut)
But I get the following error when reading binary data
Error:(18, 47) could not find implicit value for evidence parameter of type com.sksamuel.avro4s.FromRecord[A$A449.this.Drapper] lazy val is = AvroInputStream.binaryDrapper ^ Error:(18, 47) not enough arguments for method binary: (implicit evidence$13: com.sksamuel.avro4s.SchemaFor[A$A449.this.Drapper], implicit evidence$14: com.sksamuel.avro4s.FromRecord[A$A449.this.Drapper])com.sksamuel.avro4s.AvroBinaryInputStream[A$A449.this.Drapper]. Unspecified value parameter evidence$14. lazy val is = AvroInputStream.binaryDrapper ^