RenderResultBufferHelper.java 6.87 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  com.adobe.service.BufDataHelper
 *  com.adobe.service.InlinedDataBuffer
 *  com.adobe.service.InlinedDataBufferHelper
 */
package com.adobe.document.xmlform;

import com.adobe.document.xmlform.FileBufferAndIdHelper;
import com.adobe.document.xmlform.FileBufferAndIdListHelper;
import com.adobe.document.xmlform.PrintBatchOutput;
import com.adobe.document.xmlform.PrintBatchOutputHelper;
import com.adobe.document.xmlform.PrintOutput;
import com.adobe.document.xmlform.PrintOutputHelper;
import com.adobe.document.xmlform.RenderBatchOutputType;
import com.adobe.document.xmlform.RenderBatchOutputTypeHelper;
import com.adobe.document.xmlform.RenderResultBuffer;
import com.adobe.document.xmlform.SinglePieceOutput;
import com.adobe.document.xmlform.SinglePieceOutputHelper;
import com.adobe.service.BufDataHelper;
import com.adobe.service.InlinedDataBuffer;
import com.adobe.service.InlinedDataBufferHelper;
import java.io.IOException;
import org.omg.CORBA.Any;
import org.omg.CORBA.IDLType;
import org.omg.CORBA.ORB;
import org.omg.CORBA.StructMember;
import org.omg.CORBA.TCKind;
import org.omg.CORBA.TypeCode;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.OutputStream;

public final class RenderResultBufferHelper {
    private static volatile TypeCode _type;

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     * Enabled force condition propagation
     * Lifted jumps to return sites
     */
    public static TypeCode type() {
        if (_type != null) return _type;
        Class<RenderResultBufferHelper> class_ = RenderResultBufferHelper.class;
        synchronized (RenderResultBufferHelper.class) {
            if (_type != null) return _type;
            {
                _type = ORB.init().create_struct_tc(RenderResultBufferHelper.id(), "RenderResultBuffer", new StructMember[]{new StructMember("isArchiveFile", ORB.init().get_primitive_tc(TCKind.from_int(8)), null), new StructMember("outputType", ORB.init().create_enum_tc(RenderBatchOutputTypeHelper.id(), "RenderBatchOutputType", new String[]{"SELFCONTAINED", "SEGMENTEDBATCH", "SINGLEPIECEBATCH"}), null), new StructMember("archiveBuffer", ORB.init().create_struct_tc(InlinedDataBufferHelper.id(), "InlinedDataBuffer", new StructMember[]{new StructMember("isInlined", ORB.init().get_primitive_tc(TCKind.from_int(8)), null), new StructMember("inlinedContentType", ORB.init().create_string_tc(0), null), new StructMember("inlinedData", ORB.init().create_alias_tc(BufDataHelper.id(), "BufData", ORB.init().create_sequence_tc(0, ORB.init().get_primitive_tc(TCKind.from_int(10)))), null), new StructMember("remoteDataBuffer", ORB.init().create_interface_tc("IDL:com/adobe/service/DataBuffer:1.0", "DataBuffer"), null)}), null), new StructMember("printOutputBuffer", ORB.init().create_struct_tc(PrintOutputHelper.id(), "PrintOutput", new StructMember[]{new StructMember("outputBuffers", ORB.init().create_alias_tc(FileBufferAndIdListHelper.id(), "FileBufferAndIdList", ORB.init().create_sequence_tc(0, ORB.init().create_struct_tc(FileBufferAndIdHelper.id(), "FileBufferAndId", new StructMember[]{new StructMember("recordId", ORB.init().create_wstring_tc(0), null), new StructMember("buffer", ORB.init().create_interface_tc("IDL:com/adobe/service/FileDataBuffer:1.0", "FileDataBuffer"), null)}))), null), new StructMember("metaDataBuffer", ORB.init().create_interface_tc("IDL:com/adobe/service/FileDataBuffer:1.0", "FileDataBuffer"), null)}), null), new StructMember("printBatchOutputBuffer", ORB.init().create_struct_tc(PrintBatchOutputHelper.id(), "PrintBatchOutput", new StructMember[]{new StructMember("initializePrintBuffer", ORB.init().create_interface_tc("IDL:com/adobe/service/FileDataBuffer:1.0", "FileDataBuffer"), null), new StructMember("printDataBuffers", ORB.init().create_alias_tc(FileBufferAndIdListHelper.id(), "FileBufferAndIdList", ORB.init().create_sequence_tc(0, ORB.init().create_struct_tc(FileBufferAndIdHelper.id(), "FileBufferAndId", new StructMember[]{new StructMember("recordId", ORB.init().create_wstring_tc(0), null), new StructMember("buffer", ORB.init().create_interface_tc("IDL:com/adobe/service/FileDataBuffer:1.0", "FileDataBuffer"), null)}))), null), new StructMember("finalizePrintBuffer", ORB.init().create_interface_tc("IDL:com/adobe/service/FileDataBuffer:1.0", "FileDataBuffer"), null), new StructMember("metaDataBuffer", ORB.init().create_interface_tc("IDL:com/adobe/service/FileDataBuffer:1.0", "FileDataBuffer"), null)}), null), new StructMember("singlePieceOutputBuffer", ORB.init().create_struct_tc(SinglePieceOutputHelper.id(), "SinglePieceOutput", new StructMember[]{new StructMember("outputBuffer", ORB.init().create_interface_tc("IDL:com/adobe/service/FileDataBuffer:1.0", "FileDataBuffer"), null), new StructMember("metaDataBuffer", ORB.init().create_interface_tc("IDL:com/adobe/service/FileDataBuffer:1.0", "FileDataBuffer"), null)}), null)});
            }
            // ** MonitorExit[var0] (shouldn't be in output)
            return _type;
        }
    }

    public static void insert(Any any, RenderResultBuffer s) {
        any.type(RenderResultBufferHelper.type());
        RenderResultBufferHelper.write(any.create_output_stream(), s);
    }

    /*
     * WARNING - Removed try catching itself - possible behaviour change.
     */
    public static RenderResultBuffer extract(Any any) {
        InputStream in = any.create_input_stream();
        try {
            RenderResultBuffer renderResultBuffer = RenderResultBufferHelper.read(in);
            return renderResultBuffer;
        }
        finally {
            try {
                in.close();
            }
            catch (IOException e) {
                throw new RuntimeException("Unexpected exception " + e.toString());
            }
        }
    }

    public static String id() {
        return "IDL:com/adobe/document/xmlform/RenderResultBuffer:1.0";
    }

    public static RenderResultBuffer read(InputStream in) {
        RenderResultBuffer result = new RenderResultBuffer();
        result.isArchiveFile = in.read_boolean();
        result.outputType = RenderBatchOutputTypeHelper.read(in);
        result.archiveBuffer = InlinedDataBufferHelper.read((InputStream)in);
        result.printOutputBuffer = PrintOutputHelper.read(in);
        result.printBatchOutputBuffer = PrintBatchOutputHelper.read(in);
        result.singlePieceOutputBuffer = SinglePieceOutputHelper.read(in);
        return result;
    }

    public static void write(OutputStream out, RenderResultBuffer s) {
        out.write_boolean(s.isArchiveFile);
        RenderBatchOutputTypeHelper.write(out, s.outputType);
        InlinedDataBufferHelper.write((OutputStream)out, (InlinedDataBuffer)s.archiveBuffer);
        PrintOutputHelper.write(out, s.printOutputBuffer);
        PrintBatchOutputHelper.write(out, s.printBatchOutputBuffer);
        SinglePieceOutputHelper.write(out, s.singlePieceOutputBuffer);
    }
}