Serialise/Deserialise List<String>
<p>I was to save an arraylist of strings into 1 column in the local database. I am having some problems doing this. Can somebody tell me where I am going wrong...</p>

<pre><code>private String serializeArray(List&lt;String&gt; array) {
    try {
        ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
        ObjectOutputStream oos = new ObjectOutputStream(bytesOut);
        oos.writeObject(array);
        oos.flush();
        oos.close();
        return Base64.encodeToString(bytesOut.toByteArray(), Base64.NO_WRAP);
    } catch (Exception e) {
        e.printStackTrace();
        return null;
    }
}

private ArrayList&lt;String&gt; deserializeArray(String string) {
    Log.d("USERDAO", string);
    try {
        ByteArrayInputStream bytesIn = new ByteArrayInputStream(Base64.decode(string, Base64.NO_WRAP));
        ObjectInputStream ois = new ObjectInputStream(bytesIn);
        return (ArrayList&lt;String&gt;) ois.readObject();
    } catch (Exception e) {
        e.printStackTrace();
        return null;
    }
}
</code></pre>

<p>I am getting a null pointer exception when returning the Arraylist on deserialise array. The serialiseArray method does return a string however I am not sure if it is correct.</p>
