ErrorMsgArrayHelper.java 1.73 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.native2pdf.bmc;

import org.omg.CORBA.Any;
import org.omg.CORBA.ORB;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;

public abstract class ErrorMsgArrayHelper {
    private static String _id = "IDL:com/adobe/native2pdf/bmc/ErrorMsgArray:1.0";
    private static TypeCode __typeCode = null;

    public static void insert(Any a, String[] that) {
        OutputStream out = a.create_output_stream();
        a.type(ErrorMsgArrayHelper.type());
        ErrorMsgArrayHelper.write(out, that);
        a.read_value(out.create_input_stream(), ErrorMsgArrayHelper.type());
    }

    public static String[] extract(Any a) {
        return ErrorMsgArrayHelper.read(a.create_input_stream());
    }

    public static synchronized TypeCode type() {
        if (__typeCode == null) {
            __typeCode = ORB.init().create_wstring_tc(0);
            __typeCode = ORB.init().create_sequence_tc(0, __typeCode);
            __typeCode = ORB.init().create_alias_tc(ErrorMsgArrayHelper.id(), "ErrorMsgArray", __typeCode);
        }
        return __typeCode;
    }

    public static String id() {
        return _id;
    }

    public static String[] read(InputStream istream) {
        String[] value = null;
        int _len0 = istream.read_long();
        value = new String[_len0];
        for (int _o1 = 0; _o1 < value.length; ++_o1) {
            value[_o1] = istream.read_wstring();
        }
        return value;
    }

    public static void write(OutputStream ostream, String[] value) {
        ostream.write_long(value.length);
        for (int _i0 = 0; _i0 < value.length; ++_i0) {
            ostream.write_wstring(value[_i0]);
        }
    }
}