title: In Java, how to convert a list of objects to byte array?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5837698/converting-any-object-to-a-byte-array-in-java">Converting any object to a byte array in java</a>  </p>
  </blockquote>
  
  
  
  <p>I have a class that needs to be cached. The cache API provides an interface that caches <code>byte[]</code>. My class contains a field as <code>List&lt;Author&gt;</code>, where <code>Author</code> is another class. What is the correct way for me to turn <code>List&lt;Author&gt;</code> to <code>byte[]</code> for caching? And retrieve the <code>byte[]</code> from cache to reconstruct the <code>List&lt;Author&gt;</code>?</p>
  
  <p>More detail about <code>Author</code> class: it is very simple, only has two <code>String</code> fields. One <code>String</code> field is possible to be <code>null</code>.</p>