PsToPdfServiceHelper.java 2.27 KB
/*
 * Decompiled with CFR 0_118.
 */
package com.adobe.ps2pdf;

import com.adobe.ps2pdf.PsToPdfService;
import com.adobe.ps2pdf._PsToPdfServiceStub;
import org.omg.CORBA.*;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.ObjectImpl;
import org.omg.CORBA.portable.OutputStream;

public final class PsToPdfServiceHelper {
    public static void insert(Any any, PsToPdfService s) {
        any.insert_Object(s);
    }

    public static PsToPdfService extract(Any any) {
        return PsToPdfServiceHelper.narrow(any.extract_Object());
    }

    public static TypeCode type() {
        return ORB.init().create_interface_tc("IDL:com/adobe/ps2pdf/PsToPdfService:1.0", "PsToPdfService");
    }

    public static String id() {
        return "IDL:com/adobe/ps2pdf/PsToPdfService:1.0";
    }

    public static PsToPdfService read(InputStream in) {
        return PsToPdfServiceHelper.narrow(in.read_Object());
    }

    public static void write(OutputStream _out, PsToPdfService s) {
        _out.write_Object(s);
    }

    public static PsToPdfService narrow(java.lang.Object obj) {
        if (obj instanceof PsToPdfService) {
            return (PsToPdfService)obj;
        }
        if (obj instanceof Object) {
            return PsToPdfServiceHelper.narrow((Object)obj);
        }
        throw new BAD_PARAM("Failed to narrow in helper");
    }

    public static PsToPdfService narrow(Object obj) {
        if (obj == null) {
            return null;
        }
        try {
            return (PsToPdfService)obj;
        }
        catch (ClassCastException c) {
            if (obj._is_a("IDL:com/adobe/ps2pdf/PsToPdfService:1.0")) {
                _PsToPdfServiceStub stub = new _PsToPdfServiceStub();
                stub._set_delegate(((ObjectImpl)obj)._get_delegate());
                return stub;
            }
            throw new BAD_PARAM("Narrow failed");
        }
    }

    public static PsToPdfService unchecked_narrow(Object obj) {
        if (obj == null) {
            return null;
        }
        try {
            return (PsToPdfService)obj;
        }
        catch (ClassCastException c) {
            _PsToPdfServiceStub stub = new _PsToPdfServiceStub();
            stub._set_delegate(((ObjectImpl)obj)._get_delegate());
            return stub;
        }
    }
}