1. /*
  2. * @(#)DoubleSeqHelper.java 1.6 00/02/02
  3. *
  4. * Copyright 1999, 2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package org.omg.CORBA;
  11. /**
  12. * org/omg/CORBA/DoubleSeqHelper.java
  13. * Generated by the IDL-to-Java compiler (portable), version "3.0"
  14. * from streams.idl
  15. * 13 May 1999 22:41:37 o'clock GMT+00:00
  16. */
  17. public final class DoubleSeqHelper
  18. {
  19. private static String _id = "IDL:omg.org/CORBA/DoubleSeq:1.0";
  20. public DoubleSeqHelper()
  21. {
  22. }
  23. public static void insert (org.omg.CORBA.Any a, double[] that)
  24. {
  25. org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
  26. a.type (type ());
  27. write (out, that);
  28. a.read_value (out.create_input_stream (), type ());
  29. }
  30. public static double[] extract (org.omg.CORBA.Any a)
  31. {
  32. return read (a.create_input_stream ());
  33. }
  34. private static org.omg.CORBA.TypeCode __typeCode = null;
  35. synchronized public static org.omg.CORBA.TypeCode type ()
  36. {
  37. if (__typeCode == null)
  38. {
  39. __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_double);
  40. __typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode);
  41. __typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.DoubleSeqHelper.id (), "DoubleSeq", __typeCode);
  42. }
  43. return __typeCode;
  44. }
  45. public static String id ()
  46. {
  47. return _id;
  48. }
  49. public static double[] read (org.omg.CORBA.portable.InputStream istream)
  50. {
  51. double value[] = null;
  52. int _len0 = istream.read_long ();
  53. value = new double[_len0];
  54. istream.read_double_array (value, 0, _len0);
  55. return value;
  56. }
  57. public static void write (org.omg.CORBA.portable.OutputStream ostream, double[] value)
  58. {
  59. ostream.write_long (value.length);
  60. ostream.write_double_array (value, 0, value.length);
  61. }
  62. }