When creating a new array and assigning a value to element 32, 36, 40, 44, etc before assigning a value to element 0 causes writeObject to behave strangely.
The problem occurs with the following code:
var array:Array = new Array();
//array[0]=0;
array[32]=1;
array[0]=0;
var byteArray:ByteArray = new ByteArray();
byteArray.writeObject(array);
byteArray.position=0;
array = byteArray.readObject();
trace(array);
Only array[0] will be defined and aray[0]==1, which is clearly not how this code is expected and intended to work, but when the line that is now a comment is added it does work as expected.