title: Cannot Serialize/Deserialize ArrayList
body: <p>I'm trying to serialize and deserialize an array list with a object inside:</p>
  
  <pre><code>HairBirt param = new HairBirt();
  param.setName("name");
  param.setValue(2.3f);
  
  HairBirt param2 = new HairBirt();
  param2.setName("name2");
  param2.setValue(2.4f);
  
  ArrayList&lt;HairBirt&gt; list = new ArrayList&lt;HairBirt&gt;();
  
  list.add(param);
  
  list.add(param2);
  
  ByteArrayOutputStream bos = null;
  try {
      bos = new ByteArrayOutputStream();
      ObjectOutputStream obj_out = new ObjectOutputStream(bos);
      obj_out.writeObject(list);
  } catch (IOException e) {
      e.printStackTrace();
  }
  
  String encoded = bos.toString();
  try {
      encoded = URLEncoder.encode(encoded, "UTF-8");
  } catch (UnsupportedEncodingException e1) {
      e1.printStackTrace();
  }
  System.out.print("The serialized output is: " + encoded);   
  
  //DECODE
  
  ArrayList&lt;HairBirt&gt; paramDecoded;
  
  String myParam = null;
  try {
      myParam = URLDecoder.decode(encoded, "UTF-8");
  } catch (UnsupportedEncodingException e1) {
      e1.printStackTrace();
  }
  System.out.println("Got parameters");
  ByteArrayInputStream bis = new ByteArrayInputStream(myParam.getBytes());
  
  try {
      ObjectInputStream obj_in = new ObjectInputStream(bis);
  
      paramDecoded = (ArrayList&lt;HairBirt&gt;) obj_in.readObject();
  } catch (IOException e) {
      e.printStackTrace();
  } catch (ClassNotFoundException e) {
      e.printStackTrace();
  }
  </code></pre>
  
  <p>The HairList object is also a serializable object.</p>
  
  <p>This code execution is returning the following error:</p>
  
  <blockquote>
    <p><code>java.io.InvalidClassException: java.util.ArrayList; local class incompatible: stream classdesc serialVersionUID = 8664875232659988799, local class serialVersionUID = 8683452581122892189</code></p>
  </blockquote>
  
  <p>in line <code>paramDecoded = (ArrayList&lt;HairBirt&gt;) obj_in.readObject();</code></p>
  
  <p>I don't know what i'm doing wrong. Can you give a tip?</p>
  
  <p>Update:</p>
  
  <p><strong>Resolved:</strong>
  Just used a native array of HairBirt instead of a ArrayList and it works:</p>
  
  <pre><code>HairBirt[] list = new HairBirt[x];
  </code></pre>
  
  <p>instead of</p>
  
  <pre><code>ArrayList&lt;HairBirt&gt; list = new ArrayList&lt;HairBirt&gt;();
  </code></pre>
  
  <p>Thank you all for your help.</p>