AvroDataInputStream

class AvroDataInputStream[T](in: InputStream, writerSchema: Option[Schema])(using decoder: Decoder[T]) extends AvroInputStream[T]

An implementation of AvroInputStream that reads values of type T written as Avro.

An implementation of AvroInputStream that reads values of type T written as Avro.

Avro data files contain the schema as part of the message payload. Therefore, no schema is necessarily required to read the data back and the decoder will use the schema present in the payload. However, for efficiency, if the schema is provided, then a decoder can be pre-built and used on each contained object.

A Decoder must be provided (usually implicitly) that will marshall avro records into instances of type T.

Value Params
decoder

a mapping from the base avro type to an instance of T

in

the input stream to read from

writerSchema

the schema that was used to write the data. Optional, but if provided will allow the decoder to be re-used for every contained object.

trait AutoCloseable
class Object
trait Matchable
class Any

Value members

Concrete methods

override def close(): Unit
Definition Classes
AvroInputStream -> AutoCloseable
override def iterator: Iterator[T]
Definition Classes
override def tryIterator: Iterator[Try[T]]
Definition Classes