1. /*
  2. * @(#)IstringHelper.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/IstringHelper.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 IstringHelper {
  15. // It is useless to have instances of this class
  16. private IstringHelper() { }
  17. public static void write(org.omg.CORBA.portable.OutputStream out, String that) {
  18. out.write_string(that);
  19. }
  20. public static String read(org.omg.CORBA.portable.InputStream in) {
  21. String that;
  22. that = in.read_string();
  23. return that;
  24. }
  25. public static String extract(org.omg.CORBA.Any a) {
  26. org.omg.CORBA.portable.InputStream in = a.create_input_stream();
  27. return read(in);
  28. }
  29. public static void insert(org.omg.CORBA.Any a, String that) {
  30. org.omg.CORBA.portable.OutputStream out = a.create_output_stream();
  31. a.type(type());
  32. write(out, that);
  33. a.read_value(out.create_input_stream(), type());
  34. }
  35. private static org.omg.CORBA.TypeCode _tc;
  36. synchronized public static org.omg.CORBA.TypeCode type() {
  37. if (_tc == null)
  38. _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));
  39. return _tc;
  40. }
  41. public static String id() {
  42. return "IDL:omg.org/CosNaming/Istring:1.0";
  43. }
  44. }