1. /*
  2. * @(#)BindingListHelper.java 1.6 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. /*
  8. * File: ./org/omg/CosNaming/BindingListHelper.java
  9. * From: nameservice.idl
  10. * Date: Tue Aug 11 03:12:09 1998
  11. * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18
  12. */
  13. package org.omg.CosNaming;
  14. public class BindingListHelper {
  15. // It is useless to have instances of this class
  16. private BindingListHelper() { }
  17. public static void write(org.omg.CORBA.portable.OutputStream out, org.omg.CosNaming.Binding[] that) {
  18. {
  19. out.write_long(that.length);
  20. for (int __index = 0 ; __index < that.length ; __index += 1) {
  21. org.omg.CosNaming.BindingHelper.write(out, that[__index]);
  22. }
  23. }
  24. }
  25. public static org.omg.CosNaming.Binding[] read(org.omg.CORBA.portable.InputStream in) {
  26. org.omg.CosNaming.Binding[] that;
  27. {
  28. int __length = in.read_long();
  29. that = new org.omg.CosNaming.Binding[__length];
  30. for (int __index = 0 ; __index < that.length ; __index += 1) {
  31. that[__index] = org.omg.CosNaming.BindingHelper.read(in);
  32. }
  33. }
  34. return that;
  35. }
  36. public static org.omg.CosNaming.Binding[] extract(org.omg.CORBA.Any a) {
  37. org.omg.CORBA.portable.InputStream in = a.create_input_stream();
  38. return read(in);
  39. }
  40. public static void insert(org.omg.CORBA.Any a, org.omg.CosNaming.Binding[] that) {
  41. org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
  42. a.type(type());
  43. write(out, that);
  44. a.read_value(out.create_input_stream(), type());
  45. }
  46. private static org.omg.CORBA.TypeCode _tc;
  47. synchronized public static org.omg.CORBA.TypeCode type() {
  48. if (_tc == null)
  49. _tc = org.omg.CORBA.ORB.init().create_alias_tc(id(), "BindingList", org.omg.CORBA.ORB.init().create_sequence_tc(0, org.omg.CosNaming.BindingHelper.type()));
  50. return _tc;
  51. }
  52. public static String id() {
  53. return "IDL:omg.org/CosNaming/BindingList:1.0";
  54. }
  55. }