Code example for ObjectOutput

Methods: writeInt, writeObject

0
        // Had to implement the Externalizable interface because Android was attempting 
        // to serialize the Path (even when marked transient). Weird. 
        @Override 
        public void writeExternal(ObjectOutput objectOutput) throws IOException
        { 
            objectOutput.writeInt(color);
            objectOutput.writeObject(points);
        } 
 
        @Override 
        public void readExternal(ObjectInput objectInput) throws IOException, ClassNotFoundException
        { 
            color = objectInput.readInt();
            points = (ArrayList<FloatPair>) objectInput.readObject();
        } 
 
        private class FloatPair implements Serializable
        { 
            float x;
            float y;