title: Serialization of an object with Kryo (Custom Serializer)
body: <p>I have an object which contains an array of objects.  I would like to </p>
  
  <ul>
  <li><p>A) store this array of objects in the same file</p></li>
  <li><p>B) use custom serialization for those objects.</p></li>
  </ul>
  
  <p>For example, I have a Map object which has Tile[][] array.  I can do Ints just fine, but confused on how to do objects:</p>
  
  <pre><code>    kryo.register(Map.class, new SimpleSerializer&lt;Map&gt;() {
          public void write(ByteBuffer buffer, Map map) {
  
              buffer.putInt(map.getId());
              System.out.println("Putting: " + map.getId());
  
  
          }
  
          public Map read(ByteBuffer buffer) {
              int id = buffer.getInt();
              System.out.println("Getting: " + id);
  
              Map map = new Map(id, null, 0, 0, 0, 0);
  
              return (map);
          }
      });
  </code></pre>