// Path: src/org/joml/jre/java/io/ObjectInput.java
// public interface ObjectInput extends DataOutput {
// 
//     double readDouble() throws IOException;
//     float readFloat() throws IOException;
//     int readInt() throws IOException;
// 
// }
// 
// Path: src/org/joml/jre/java/io/ObjectOutput.java
// public interface ObjectOutput extends DataOutput {
//     void writeObject(Object obj);
// }


import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
     * - Matrix4d.equals(Matrix4dStack) is true iff all the 16 matrix elements are equal
     * - Matrix4dStack.equals(Matrix4d) is true iff all the 16 matrix elements are equal
     * - Matrix4dStack.equals(Matrix4dStack) is true iff all 16 matrix elements are equal AND the matrix arrays as well as the stack pointer are equal
     * - everything else is inequal
     */
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (!super.equals(obj))
            return false;
        if (obj instanceof Matrix4dStack) {
            Matrix4dStack other = (Matrix4dStack) obj;
            if (curr != other.curr)
                return false;
            for (int i = 0; i < curr; i++) {
                if (!mats[i].equals(other.mats[i]))
                    return false;
            }
        }
        return true;
    }

    public void writeExternal(ObjectOutput out) throws IOException {
        super.writeExternal(out);
        out.writeInt(curr);
        for (int i = 0; i < curr; i++) {
            out.writeObject(mats[i]);
        }
    }

// Path: src/org/joml/jre/java/io/ObjectInput.java
// public interface ObjectInput extends DataOutput {
// 
//     double readDouble() throws IOException;
//     float readFloat() throws IOException;
//     int readInt() throws IOException;
// 
// }
// 
// Path: src/org/joml/jre/java/io/ObjectOutput.java
// public interface ObjectOutput extends DataOutput {
//     void writeObject(Object obj);
// }


// Path: src/org/joml/Matrix4dStack.java
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;

     * - Matrix4d.equals(Matrix4dStack) is true iff all the 16 matrix elements are equal
     * - Matrix4dStack.equals(Matrix4d) is true iff all the 16 matrix elements are equal
     * - Matrix4dStack.equals(Matrix4dStack) is true iff all 16 matrix elements are equal AND the matrix arrays as well as the stack pointer are equal
     * - everything else is inequal
     */
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (!super.equals(obj))
            return false;
        if (obj instanceof Matrix4dStack) {
            Matrix4dStack other = (Matrix4dStack) obj;
            if (curr != other.curr)
                return false;
            for (int i = 0; i < curr; i++) {
                if (!mats[i].equals(other.mats[i]))
                    return false;
            }
        }
        return true;
    }

    public void writeExternal(ObjectOutput out) throws IOException {
        super.writeExternal(out);
        out.writeInt(curr);
        for (int i = 0; i < curr; i++) {
            out.writeObject(mats[i]);
        }
    }

    public void readExternal(ObjectInput in) throws IOException {