/*
 * Automatically generated by jrpcgen 1.1.6 on 21.02.24 22:11
 * jrpcgen is part of the "Remote Tea" ONC/RPC package for Java
 * See http://remotetea.sourceforge.net for details
 */
package tests.org.acplt.oncrpc.jrpcgen;
import org.acplt.oncrpc.*;
import java.io.IOException;

public class demoCodingSupplement {

    public static PredefinedTypeA xdrDecode_PredefinedTypeA(XdrDecodingStream xdr)
           throws OncRpcException, IOException {
        PredefinedTypeA $result = new PredefinedTypeA();
        $result.xdrDecode(xdr);
        return $result;
    }

    public static PredefinedTypeC xdrDecode_PredefinedTypeC(XdrDecodingStream xdr)
           throws OncRpcException, IOException {
        PredefinedTypeC $result = new PredefinedTypeC();
        $result.xdrDecode(xdr);
        return $result;
    }

    public static void xdrEncodeFixedVector_PredefinedTypeC(XdrEncodingStream xdr, PredefinedTypeC[] vector, int size)
           throws OncRpcException, IOException {
        if (vector.length != size) {
            throw new IllegalArgumentException("array size does not match protocol specification");
        }

        for (int index = 0; index < size; index++) {
            vector[index].xdrEncode(xdr);
        }
    }

    public static PredefinedTypeC[] xdrDecodeFixedVector_PredefinedTypeC(XdrDecodingStream xdr, int size)
           throws OncRpcException, IOException {
        PredefinedTypeC[] vector = new PredefinedTypeC[size];

        for (int index = 0; index < size; index++) {
            vector[index] = demoCodingSupplement.xdrDecode_PredefinedTypeC(xdr);
        }

        return vector;
    }

    public static void xdrEncodeDynamicVector_PredefinedTypeC(XdrEncodingStream xdr, PredefinedTypeC[] vector)
           throws OncRpcException, IOException {
        xdr.xdrEncodeInt(vector.length);
        xdrEncodeFixedVector_PredefinedTypeC(xdr, vector, vector.length);
    }

    public static PredefinedTypeC[] xdrDecodeDynamicVector_PredefinedTypeC(XdrDecodingStream xdr)
           throws OncRpcException, IOException {
        return xdrDecodeFixedVector_PredefinedTypeC(xdr, xdr.xdrDecodeInt());
    }

    public static PredefinedTypeB xdrDecode_PredefinedTypeB(XdrDecodingStream xdr)
           throws OncRpcException, IOException {
        PredefinedTypeB $result = new PredefinedTypeB();
        $result.xdrDecode(xdr);
        return $result;
    }

    public static void xdrEncodeFixedVector_PredefinedTypeB(XdrEncodingStream xdr, PredefinedTypeB[] vector, int size)
           throws OncRpcException, IOException {
        if (vector.length != size) {
            throw new IllegalArgumentException("array size does not match protocol specification");
        }

        for (int index = 0; index < size; index++) {
            vector[index].xdrEncode(xdr);
        }
    }

    public static PredefinedTypeB[] xdrDecodeFixedVector_PredefinedTypeB(XdrDecodingStream xdr, int size)
           throws OncRpcException, IOException {
        PredefinedTypeB[] vector = new PredefinedTypeB[size];

        for (int index = 0; index < size; index++) {
            vector[index] = demoCodingSupplement.xdrDecode_PredefinedTypeB(xdr);
        }

        return vector;
    }
}
// End of demoCodingSupplement.java
