title: What is the purpose of DatumWriter in Avro
body: <p><code>Avro</code> website has an example:</p>
  
  <pre><code>DatumWriter&lt;User&gt; userDatumWriter = new SpecificDatumWriter&lt;User&gt;(User.class);
  DataFileWriter&lt;User&gt; dataFileWriter = new DataFileWriter&lt;User&gt;(userDatumWriter);
  dataFileWriter.create(user1.getSchema(), new File("users.avro"));
  dataFileWriter.append(user1);
  dataFileWriter.append(user2);
  dataFileWriter.append(user3);
  dataFileWriter.close();
  </code></pre>
  
  <p>What is the purpose of <code>DatumWriter&lt;User&gt;</code>? I mean what it does provide? It provides <code>write</code> method, but instead of using it we use <code>DataFileWriter</code>. Can someone explain the design purpose of it?</p>