1. /*
  2. * @(#)ValueBaseHelper.java 1.11 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. /**
  8. * The Helper for <tt>ValueBase</tt>. For more information on
  9. * Helper files, see <a href="doc-files/generatedfiles.html#helper">
  10. * "Generated Files: Helper Files"</a>.<P>
  11. */
  12. /*
  13. * @(#)ValueBaseHelper.java 1.11 03/01/23
  14. */
  15. /*
  16. * Licensed Materials - Property of IBM
  17. * RMI-IIOP v1.0
  18. * Copyright IBM Corp. 1998 1999 All Rights Reserved
  19. *
  20. * US Government Users Restricted Rights - Use, duplication or
  21. * disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  22. */
  23. package org.omg.CORBA;
  24. abstract public class ValueBaseHelper
  25. {
  26. private static String _id = "IDL:omg.org/CORBA/ValueBase:1.0";
  27. public static void insert (org.omg.CORBA.Any a, java.io.Serializable that)
  28. {
  29. org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
  30. a.type (type ());
  31. write (out, that);
  32. a.read_value (out.create_input_stream (), type ());
  33. }
  34. public static java.io.Serializable extract (org.omg.CORBA.Any a)
  35. {
  36. return read (a.create_input_stream ());
  37. }
  38. private static org.omg.CORBA.TypeCode __typeCode = null;
  39. synchronized public static org.omg.CORBA.TypeCode type ()
  40. {
  41. if (__typeCode == null)
  42. {
  43. __typeCode = org.omg.CORBA.ORB.init ().get_primitive_tc (TCKind.tk_value);
  44. }
  45. return __typeCode;
  46. }
  47. public static String id ()
  48. {
  49. return _id;
  50. }
  51. public static java.io.Serializable read (org.omg.CORBA.portable.InputStream istream)
  52. {
  53. return ((org.omg.CORBA_2_3.portable.InputStream)istream).read_value ();
  54. }
  55. public static void write (org.omg.CORBA.portable.OutputStream ostream, java.io.Serializable value)
  56. {
  57. ((org.omg.CORBA_2_3.portable.OutputStream)ostream).write_value (value);
  58. }
  59. }