FloatSeqHelper.java revision 608:7e06bf1dcb09
1296190Spfg/* 2219732Sume * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved. 3219732Sume * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4219732Sume * 5219732Sume * This code is free software; you can redistribute it and/or modify it 6219732Sume * under the terms of the GNU General Public License version 2 only, as 7219732Sume * published by the Free Software Foundation. Oracle designates this 8219732Sume * particular file as subject to the "Classpath" exception as provided 9219732Sume * by Oracle in the LICENSE file that accompanied this code. 10219732Sume * 11219732Sume * This code is distributed in the hope that it will be useful, but WITHOUT 12219732Sume * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13219732Sume * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14219732Sume * version 2 for more details (a copy is included in the LICENSE file that 15219732Sume * accompanied this code). 16219732Sume * 17219732Sume * You should have received a copy of the GNU General Public License version 18219732Sume * 2 along with this work; if not, write to the Free Software Foundation, 19219732Sume * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20219732Sume * 21219732Sume * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22219732Sume * or visit www.oracle.com if you need additional information or have any 23219732Sume * questions. 24219732Sume */ 25313980Spfgpackage org.omg.CORBA; 26282434Sgjb 27219732Sume 28219732Sume/** 29219732Sume* The Helper for <tt>FloatSeq</tt>. For more information on 30219732Sume* Helper files, see <a href="doc-files/generatedfiles.html#helper"> 31219732Sume* "Generated Files: Helper Files"</a>.<P> 32219732Sume* org/omg/CORBA/FloatSeqHelper.java 33219732Sume* Generated by the IDL-to-Java compiler (portable), version "3.0" 34219732Sume* from streams.idl 35219732Sume* 13 May 1999 22:41:37 o'clock GMT+00:00 36219732Sume* 37219732Sume* The class definition has been modified to conform to the following 38219732Sume* OMG specifications : 39219732Sume* <ul> 40219732Sume* <li> ORB core as defined by CORBA 2.3.1 41219732Sume* (<a href="http://cgi.omg.org/cgi-bin/doc?formal/99-10-07">formal/99-10-07</a>) 42219732Sume* </li> 43219732Sume* 44219732Sume* <li> IDL/Java Language Mapping as defined in 45296190Spfg* <a href="http://cgi.omg.org/cgi-bin/doc?ptc/00-01-08">ptc/00-01-08</a> 46282434Sgjb* </li> 47296190Spfg* </ul> 48296190Spfg*/ 49296190Spfg 50219732Sumepublic abstract class FloatSeqHelper 51221297Sume{ 52219732Sume private static String _id = "IDL:omg.org/CORBA/FloatSeq:1.0"; 53219732Sume 54282434Sgjb public static void insert (org.omg.CORBA.Any a, float[] that) 55282434Sgjb { 56282434Sgjb org.omg.CORBA.portable.OutputStream out = a.create_output_stream (); 57219732Sume a.type (type ()); 58219732Sume write (out, that); 59282434Sgjb a.read_value (out.create_input_stream (), type ()); 60282434Sgjb } 61282434Sgjb 62282434Sgjb public static float[] extract (org.omg.CORBA.Any a) 63282434Sgjb { 64219732Sume return read (a.create_input_stream ()); 65219732Sume } 66219732Sume 67219732Sume private static org.omg.CORBA.TypeCode __typeCode = null; 68219732Sume synchronized public static org.omg.CORBA.TypeCode type () 69219732Sume { 70219732Sume if (__typeCode == null) 71219732Sume { 72313980Spfg __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_float); 73313980Spfg __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode); 74313980Spfg __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.FloatSeqHelper.id (), "FloatSeq", __typeCode); 75313980Spfg } 76313980Spfg return __typeCode; 77282434Sgjb } 78282434Sgjb 79282434Sgjb public static String id () 80219732Sume { 81219732Sume return _id; 82219732Sume } 83219732Sume 84282434Sgjb public static float[] read (org.omg.CORBA.portable.InputStream istream) 85282434Sgjb { 86282434Sgjb float value[] = null; 87282434Sgjb int _len0 = istream.read_long (); 88219732Sume value = new float[_len0]; 89219732Sume istream.read_float_array (value, 0, _len0); 90219732Sume return value; 91219732Sume } 92219732Sume 93219732Sume public static void write (org.omg.CORBA.portable.OutputStream ostream, float[] value) 94282434Sgjb { 95282434Sgjb ostream.write_long (value.length); 96282434Sgjb ostream.write_float_array (value, 0, value.length); 97282434Sgjb } 98219732Sume 99219732Sume} 100219732Sume