title: serialize and deserialize from flatbuffers to and from bytearray
body: <p>hi stackoverflow community :)</p>
  
  <p>i want create a flatbuffers object in java which i can serialize to a byte array,
  and later deserialize back in the java object. i work the first time with flatbuffers
  and i can't initialised a java object. my way step by step:</p>
  
  <ol>
  <li>write a scheme</li>
  <li>compile this with the flatbuffers compiler into a java class</li>
  <li>import the flatbuffers class from github</li>
  <li>try to build a java object</li>
  </ol>
  
  <p>Here is my code for step 4:</p>
  
  <pre><code>FlatBufferBuilder fbb = new FlatBufferBuilder(1);
  int str = fbb.createString("Dummy");
  Monster.startPerson(fbb);
  Monster.addName(fbb, str);
  int p = Person.endPerson(fbb);
  </code></pre>
  
  <p>Maybe someone can post a simple example to creating a flatbuffers object, and how to serialize and deserialize to and from bytearray?</p>
  
  <p>Hope for an answer and best regards,</p>
  
  <p>Paul</p>
  
  <p><a href="http://google.github.io/flatbuffers/" rel="nofollow">http://google.github.io/flatbuffers/</a></p>