1. /*
  2. * @(#)ServiceDetailHelper.java 1.3 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. package org.omg.CORBA;
  8. public class ServiceDetailHelper {
  9. // It is useless to have instances of this class
  10. private ServiceDetailHelper() { }
  11. public static void write(org.omg.CORBA.portable.OutputStream out, org.omg.CORBA.ServiceDetail that) {
  12. out.write_ulong(that.service_detail_type);
  13. {
  14. out.write_long(that.service_detail.length);
  15. out.write_octet_array(that.service_detail, 0, that.service_detail.length);
  16. }
  17. }
  18. public static org.omg.CORBA.ServiceDetail read(org.omg.CORBA.portable.InputStream in) {
  19. org.omg.CORBA.ServiceDetail that = new org.omg.CORBA.ServiceDetail();
  20. that.service_detail_type = in.read_ulong();
  21. {
  22. int __length = in.read_long();
  23. that.service_detail = new byte[__length];
  24. in.read_octet_array(that.service_detail, 0, that.service_detail.length);
  25. }
  26. return that;
  27. }
  28. public static org.omg.CORBA.ServiceDetail extract(org.omg.CORBA.Any a) {
  29. org.omg.CORBA.portable.InputStream in = a.create_input_stream();
  30. return read(in);
  31. }
  32. public static void insert(org.omg.CORBA.Any a, org.omg.CORBA.ServiceDetail that) {
  33. org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
  34. write(out, that);
  35. a.read_value(out.create_input_stream(), type());
  36. }
  37. private static org.omg.CORBA.TypeCode _tc;
  38. synchronized public static org.omg.CORBA.TypeCode type() {
  39. int _memberCount = 2;
  40. org.omg.CORBA.StructMember[] _members = null;
  41. if (_tc == null) {
  42. _members= new org.omg.CORBA.StructMember[2];
  43. _members[0] = new org.omg.CORBA.StructMember(
  44. "service_detail_type",
  45. org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_ulong),
  46. null);
  47. _members[1] = new org.omg.CORBA.StructMember(
  48. "service_detail",
  49. org.omg.CORBA.ORB.init().create_sequence_tc(0, org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_octet)),
  50. null);
  51. _tc = org.omg.CORBA.ORB.init().create_struct_tc(id(), "ServiceDetail", _members);
  52. }
  53. return _tc;
  54. }
  55. public static String id() {
  56. return "IDL:omg.org/CORBA/ServiceDetail:1.0";
  57. }
  58. }