001    package org.omg.CORBA;
002    
003    /**
004     * Generated from IDL alias "ShortSeq".
005     *
006     * @author JacORB IDL compiler V 2.3.0 (JBoss patch 6), 06-Jun-2007
007     * @version generated at Sep 22, 2012 10:58:05 AM
008     */
009    
010    public final class ShortSeqHelper
011    {
012            private static org.omg.CORBA.TypeCode _type = null;
013    
014            public static void insert (org.omg.CORBA.Any any, short[] s)
015            {
016                    any.type (type ());
017                    write (any.create_output_stream (), s);
018            }
019    
020            public static short[] extract (final org.omg.CORBA.Any any)
021            {
022                    return read (any.create_input_stream ());
023            }
024    
025            public static org.omg.CORBA.TypeCode type ()
026            {
027                    if (_type == null)
028                    {
029                            _type = org.omg.CORBA.ORB.init().create_alias_tc(org.omg.CORBA.ShortSeqHelper.id(), "ShortSeq",org.omg.CORBA.ORB.init().create_sequence_tc(0, org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.from_int(2))));
030                    }
031                    return _type;
032            }
033    
034            public static String id()
035            {
036                    return "IDL:omg.org/CORBA/ShortSeq:1.0";
037            }
038            public static short[] read (final org.omg.CORBA.portable.InputStream _in)
039            {
040                    short[] _result;
041                    int _l_result32 = _in.read_long();
042                    try
043                    {
044                             int x = _in.available();
045                             if ( x > 0 && _l_result32 > x )
046                                    {
047                                            throw new org.omg.CORBA.MARSHAL("Sequence length too large. Only " + x + " available and trying to assign " + _l_result32);
048                                    }
049                    }
050                    catch (java.io.IOException e)
051                    {
052                    }
053                    _result = new short[_l_result32];
054                    _in.read_short_array(_result,0,_l_result32);
055                    return _result;
056            }
057    
058            public static void write (final org.omg.CORBA.portable.OutputStream _out, short[] _s)
059            {
060                    
061                    _out.write_long(_s.length);
062                    _out.write_short_array(_s,0,_s.length);
063            }
064    }