1. package org.omg.IOP;
  2. /**
  3. * org/omg/IOP/CodecOperations.java .
  4. * Generated by the IDL-to-Java compiler (portable), version "3.2"
  5. * from ../../../../src/share/classes/org/omg/PortableInterceptor/IOP.idl
  6. * Wednesday, September 15, 2004 10:28:42 AM GMT
  7. */
  8. /**
  9. * The formats of IOR components and service context data used by ORB
  10. * services are often defined as CDR encapsulations encoding instances
  11. * of IDL defined data types. The <code>Codec</code> provides a mechanism
  12. * to transfer these components between their IDL data types and their CDR
  13. * encapsulation representations.
  14. * <p>
  15. * A <code>Codec</code> is obtained from the <code>CodecFactory</code>.
  16. * The <code>CodecFactory</code> is obtained through a call to
  17. * <code>ORB.resolve_initial_references( "CodecFactory" )</code>.
  18. */
  19. public interface CodecOperations
  20. {
  21. /**
  22. * Converts the given any into a byte array based on the encoding
  23. * format effective for this <code>Codec</code>.
  24. *
  25. * @param data The data, in the form of an any, to be encoded into
  26. * a byte array.
  27. * @return A byte array containing the encoded Any. This byte array
  28. * contains both the <code>TypeCode</code> and the data of the type.
  29. * @exception InvalidTypeForEncoding thrown if the type is not valid for
  30. * the encoding format effective for this <code>Codec</code>.
  31. */
  32. byte[] encode (org.omg.CORBA.Any data) throws org.omg.IOP.CodecPackage.InvalidTypeForEncoding;
  33. /**
  34. * Decodes the given byte array into an Any based on the encoding
  35. * format effective for this <code>Codec</code>.
  36. *
  37. * @param data The data, in the form of a byte array, to be decoded into
  38. * an Any.
  39. * @return An Any containing the data from the decoded byte array.
  40. * @exception FormatMismatch is thrown if the byte array cannot be
  41. * decoded into an Any.
  42. */
  43. org.omg.CORBA.Any decode (byte[] data) throws org.omg.IOP.CodecPackage.FormatMismatch;
  44. /**
  45. * Converts the given any into a byte array based on the encoding
  46. * format effective for this Codec. Only the data from the Any is
  47. * encoded, not the <code>TypeCode</code>.
  48. *
  49. * @param data The data, in the form of an Any, to be encoded into
  50. * a byte array.
  51. * @return A byte array containing the data from the encoded any.
  52. * @exception InvalidTypeForEncoding thrown if the type is not valid for
  53. * the encoding format effective for this <code>Codec</code>.
  54. */
  55. byte[] encode_value (org.omg.CORBA.Any data) throws org.omg.IOP.CodecPackage.InvalidTypeForEncoding;
  56. /**
  57. * Decodes the given byte array into an Any based on the given
  58. * <code>TypeCode</code> and the encoding format effective for
  59. * this <code>Codec</code>.
  60. *
  61. * @param data The data, in the form of a byte array, to be decoded
  62. * into an Any.
  63. * @param tc The TypeCode to be used to decode the data.
  64. * @return An Any containing the data from the decoded byte array.
  65. * @exception FormatMismatch thrown if the byte array cannot be
  66. * decoded into an Any.
  67. */
  68. org.omg.CORBA.Any decode_value (byte[] data, org.omg.CORBA.TypeCode tc) throws org.omg.IOP.CodecPackage.FormatMismatch, org.omg.IOP.CodecPackage.TypeMismatch;
  69. } // interface CodecOperations