org.apache.avro.io

## Interface DatumWriter<D>

- All Known Implementing Classes:
    GenericDatumWriter, Json.ObjectWriter, ProtobufDatumWriter, ReflectDatumWriter, SpecificDatumWriter, ThriftDatumWriter

      public interface DatumWriter<D>

  Write data of a schema.

  Implemented for different in-memory data representations.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `setSchema(Schema schema)` Set the schema.
    `void` | `write(D datum, Encoder out)` Write a datum.

- - ### Method Detail

    - #### setSchema

          void setSchema(Schema schema)

      Set the schema.

    - #### write

          void write(D datum,
                     Encoder out)
              throws IOException

      Write a datum. Traverse the schema, depth first, writing each leaf value in the schema from the datum to the output.
      Throws:
        `IOException`

Copyright © 2009–2024 The Apache Software Foundation. All rights reserved.