1. /*
  2. * @(#)AnySeqHelper.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/AnySeqHelper.java
  13. * Generated by the IDL-to-Java compiler (portable), version "3.0"
  14. * from streams.idl
  15. * 13 May 1999 22:41:36 o'clock GMT+00:00
  16. */
  17. public final class AnySeqHelper
  18. {
  19. private static String _id = "IDL:omg.org/CORBA/AnySeq:1.0";
  20. public AnySeqHelper()
  21. {
  22. }
  23. public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.Any[] 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 org.omg.CORBA.Any[] 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_any);
  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.AnySeqHelper.id (), "AnySeq", __typeCode);
  42. }
  43. return __typeCode;
  44. }
  45. public static String id ()
  46. {
  47. return _id;
  48. }
  49. public static org.omg.CORBA.Any[] read (org.omg.CORBA.portable.InputStream istream)
  50. {
  51. org.omg.CORBA.Any value[] = null;
  52. int _len0 = istream.read_long ();
  53. value = new org.omg.CORBA.Any[_len0];
  54. for (int _o1 = 0;_o1 < value.length; ++_o1)
  55. value[_o1] = istream.read_any ();
  56. return value;
  57. }
  58. public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.Any[] value)
  59. {
  60. ostream.write_long (value.length);
  61. for (int _i0 = 0;_i0 < value.length; ++_i0)
  62. ostream.write_any (value[_i0]);
  63. }
  64. }