package org.omg.IOP;


/**
* org/omg/IOP/CodecOperations.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from /var/lib/jenkins/jobs/openjdk/jobs/openjdk10/workspace/jdk-updates_jdk10u/src/java.corba/share/classes/org/omg/PortableInterceptor/IOP.idl
* Sunday, February 14, 2021 at 5:20:31 PM Coordinated Universal Time
*/


The formats of IOR components and service context data used by ORB services are often defined as CDR encapsulations encoding instances of IDL defined data types. The Codec provides a mechanism to transfer these components between their IDL data types and their CDR encapsulation representations.

A Codec is obtained from the CodecFactory. The CodecFactory is obtained through a call to ORB.resolve_initial_references( "CodecFactory" ).

/** * The formats of IOR components and service context data used by ORB * services are often defined as CDR encapsulations encoding instances * of IDL defined data types. The <code>Codec</code> provides a mechanism * to transfer these components between their IDL data types and their CDR * encapsulation representations. * <p> * A <code>Codec</code> is obtained from the <code>CodecFactory</code>. * The <code>CodecFactory</code> is obtained through a call to * <code>ORB.resolve_initial_references( "CodecFactory" )</code>. */
public interface CodecOperations {
Converts the given any into a byte array based on the encoding format effective for this Codec.
Params:
  • data – The data, in the form of an any, to be encoded into a byte array.
Throws:
  • InvalidTypeForEncoding – thrown if the type is not valid for the encoding format effective for this Codec.
Returns:A byte array containing the encoded Any. This byte array contains both the TypeCode and the data of the type.
/** * Converts the given any into a byte array based on the encoding * format effective for this <code>Codec</code>. * * @param data The data, in the form of an any, to be encoded into * a byte array. * @return A byte array containing the encoded Any. This byte array * contains both the <code>TypeCode</code> and the data of the type. * @exception InvalidTypeForEncoding thrown if the type is not valid for * the encoding format effective for this <code>Codec</code>. */
byte[] encode (org.omg.CORBA.Any data) throws org.omg.IOP.CodecPackage.InvalidTypeForEncoding;
Decodes the given byte array into an Any based on the encoding format effective for this Codec.
Params:
  • data – The data, in the form of a byte array, to be decoded into an Any.
Throws:
  • FormatMismatch – is thrown if the byte array cannot be decoded into an Any.
Returns:An Any containing the data from the decoded byte array.
/** * Decodes the given byte array into an Any based on the encoding * format effective for this <code>Codec</code>. * * @param data The data, in the form of a byte array, to be decoded into * an Any. * @return An Any containing the data from the decoded byte array. * @exception FormatMismatch is thrown if the byte array cannot be * decoded into an Any. */
org.omg.CORBA.Any decode (byte[] data) throws org.omg.IOP.CodecPackage.FormatMismatch;
Converts the given any into a byte array based on the encoding format effective for this Codec. Only the data from the Any is encoded, not the TypeCode.
Params:
  • data – The data, in the form of an Any, to be encoded into a byte array.
Throws:
  • InvalidTypeForEncoding – thrown if the type is not valid for the encoding format effective for this Codec.
Returns:A byte array containing the data from the encoded any.
/** * Converts the given any into a byte array based on the encoding * format effective for this Codec. Only the data from the Any is * encoded, not the <code>TypeCode</code>. * * @param data The data, in the form of an Any, to be encoded into * a byte array. * @return A byte array containing the data from the encoded any. * @exception InvalidTypeForEncoding thrown if the type is not valid for * the encoding format effective for this <code>Codec</code>. */
byte[] encode_value (org.omg.CORBA.Any data) throws org.omg.IOP.CodecPackage.InvalidTypeForEncoding;
Decodes the given byte array into an Any based on the given TypeCode and the encoding format effective for this Codec.
Params:
  • data – The data, in the form of a byte array, to be decoded into an Any.
  • tc – The TypeCode to be used to decode the data.
Throws:
  • FormatMismatch – thrown if the byte array cannot be decoded into an Any.
Returns:An Any containing the data from the decoded byte array.
/** * Decodes the given byte array into an Any based on the given * <code>TypeCode</code> and the encoding format effective for * this <code>Codec</code>. * * @param data The data, in the form of a byte array, to be decoded * into an Any. * @param tc The TypeCode to be used to decode the data. * @return An Any containing the data from the decoded byte array. * @exception FormatMismatch thrown if the byte array cannot be * decoded into an Any. */
org.omg.CORBA.Any decode_value (byte[] data, org.omg.CORBA.TypeCode tc) throws org.omg.IOP.CodecPackage.FormatMismatch, org.omg.IOP.CodecPackage.TypeMismatch; } // interface CodecOperations