1. /*
  2. * @(#)IstringHelper.java 1.10 00/02/02
  3. *
  4. * Copyright 1997-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. /*
  11. * File: ./org/omg/CosNaming/IstringHelper.java
  12. * From: nameservice.idl
  13. * Date: Tue Aug 11 03:12:09 1998
  14. * By: idltojava Java IDL 1.2 Aug 11 1998 02:00:18
  15. */
  16. package org.omg.CosNaming;
  17. public class IstringHelper {
  18. // It is useless to have instances of this class
  19. private IstringHelper() { }
  20. public static void write(org.omg.CORBA.portable.OutputStream out, String that) {
  21. out.write_string(that);
  22. }
  23. public static String read(org.omg.CORBA.portable.InputStream in) {
  24. String that;
  25. that = in.read_string();
  26. return that;
  27. }
  28. public static String 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, String that) {
  33. org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
  34. a.type(type());
  35. write(out, that);
  36. a.read_value(out.create_input_stream(), type());
  37. }
  38. private static org.omg.CORBA.TypeCode _tc;
  39. synchronized public static org.omg.CORBA.TypeCode type() {
  40. if (_tc == null)
  41. _tc = org.omg.CORBA.ORB.init().create_alias_tc(id(), "Istring", org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_string));
  42. return _tc;
  43. }
  44. public static String id() {
  45. return "IDL:omg.org/CosNaming/Istring:1.0";
  46. }
  47. }