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