objectOutputStream.writeInt(data.length); for (int i = 0; i < size; ++i)
if (data == null)
  private synchronized void writeObject(ObjectOutputStream objectOutputStream) throws IOException  {    objectOutputStream.defaultWriteObject();    objectOutputStream.writeInt(data.length);    for (int i = 0; i < size; ++i)    {      objectOutputStream.writeObject(data[i]);    }  }