org.apache.avro.io

## Interface DatumReader<D>

All Known Subinterfaces:
  FastReaderBuilder.FieldReader, FastReaderBuilder.ReusingFieldReader

All Known Implementing Classes:
  FastReaderBuilder.MapReader, FastReaderBuilder.RecordReader, GenericDatumReader, Json.ObjectReader, ReflectDatumReader, SpecificDatumReader

    public interface DatumReader<D>

Read data of a schema.

Determines the in-memory data representation.

### Method Summary

All Methods Instance Methods Abstract Methods
`D` `read(D reuse, Decoder in)` Read a datum.
`void` `setSchema(Schema schema)` Set the writer's schema.

### Method Detail

#### setSchema

    void setSchema(Schema schema)

Set the writer's schema.

#### read

    D read(D reuse,
           Decoder in)
    throws IOException

Read a datum. Traverse the schema, depth-first, reading all leaf values in the schema into a datum that is returned. If the provided datum is non-null it may be reused and returned.

Throws:
  `IOException`