org.omg.IOP
Interface CodecOperations

All Known Subinterfaces:
Codec sample code for org.omg.IOP.Codec definition code for org.omg.IOP.Codec

public interface CodecOperations

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" ).


Method Summary
 Any sample code for org.omg.CORBA.Any definition code for org.omg.CORBA.Any decode_value sample code for org.omg.IOP.CodecOperations.decode_value(byte[], org.omg.CORBA.TypeCode) definition code for org.omg.IOP.CodecOperations.decode_value(byte[], org.omg.CORBA.TypeCode) (byte[] data, TypeCode sample code for org.omg.CORBA.TypeCode definition code for org.omg.CORBA.TypeCode  tc)
          Decodes the given byte array into an Any based on the given TypeCode and the encoding format effective for this Codec.
 Any sample code for org.omg.CORBA.Any definition code for org.omg.CORBA.Any decode sample code for org.omg.IOP.CodecOperations.decode(byte[]) definition code for org.omg.IOP.CodecOperations.decode(byte[]) (byte[] data)
          Decodes the given byte array into an Any based on the encoding format effective for this Codec.
 byte[] encode_value sample code for org.omg.IOP.CodecOperations.encode_value(org.omg.CORBA.Any) definition code for org.omg.IOP.CodecOperations.encode_value(org.omg.CORBA.Any) (Any sample code for org.omg.CORBA.Any definition code for org.omg.CORBA.Any  data)
          Converts the given any into a byte array based on the encoding format effective for this Codec.
 byte[] encode sample code for org.omg.IOP.CodecOperations.encode(org.omg.CORBA.Any) definition code for org.omg.IOP.CodecOperations.encode(org.omg.CORBA.Any) (Any sample code for org.omg.CORBA.Any definition code for org.omg.CORBA.Any  data)
          Converts the given any into a byte array based on the encoding format effective for this Codec.
 

Method Detail

encode sample code for org.omg.IOP.CodecOperations.encode(org.omg.CORBA.Any) definition code for org.omg.IOP.CodecOperations.encode(org.omg.CORBA.Any)

byte[] encode(Any sample code for org.omg.CORBA.Any definition code for org.omg.CORBA.Any  data)
              throws InvalidTypeForEncoding sample code for org.omg.IOP.CodecPackage.InvalidTypeForEncoding definition code for org.omg.IOP.CodecPackage.InvalidTypeForEncoding 
Converts the given any into a byte array based on the encoding format effective for this Codec.

Parameters:
data - The data, in the form of an any, to be encoded into a byte array.
Returns:
A byte array containing the encoded Any. This byte array contains both the TypeCode and the data of the type.
Throws:
InvalidTypeForEncoding - thrown if the type is not valid for the encoding format effective for this Codec.

decode sample code for org.omg.IOP.CodecOperations.decode(byte[]) definition code for org.omg.IOP.CodecOperations.decode(byte[])

Any sample code for org.omg.CORBA.Any definition code for org.omg.CORBA.Any  decode(byte[] data)
           throws FormatMismatch sample code for org.omg.IOP.CodecPackage.FormatMismatch definition code for org.omg.IOP.CodecPackage.FormatMismatch 
Decodes the given byte array into an Any based on the encoding format effective for this Codec.

Parameters:
data - The data, in the form of a byte array, to be decoded into an Any.
Returns:
An Any containing the data from the decoded byte array.
Throws:
FormatMismatch - is thrown if the byte array cannot be decoded into an Any.

encode_value sample code for org.omg.IOP.CodecOperations.encode_value(org.omg.CORBA.Any) definition code for org.omg.IOP.CodecOperations.encode_value(org.omg.CORBA.Any)

byte[] encode_value(Any sample code for org.omg.CORBA.Any definition code for org.omg.CORBA.Any  data)
                    throws InvalidTypeForEncoding sample code for org.omg.IOP.CodecPackage.InvalidTypeForEncoding definition code for org.omg.IOP.CodecPackage.InvalidTypeForEncoding 
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.

Parameters:
data - The data, in the form of an Any, to be encoded into a byte array.
Returns:
A byte array containing the data from the encoded any.
Throws:
InvalidTypeForEncoding - thrown if the type is not valid for the encoding format effective for this Codec.

decode_value sample code for org.omg.IOP.CodecOperations.decode_value(byte[], org.omg.CORBA.TypeCode) definition code for org.omg.IOP.CodecOperations.decode_value(byte[], org.omg.CORBA.TypeCode)

Any sample code for org.omg.CORBA.Any definition code for org.omg.CORBA.Any  decode_value(byte[] data,
                 TypeCode sample code for org.omg.CORBA.TypeCode definition code for org.omg.CORBA.TypeCode  tc)
                 throws FormatMismatch sample code for org.omg.IOP.CodecPackage.FormatMismatch definition code for org.omg.IOP.CodecPackage.FormatMismatch ,
                        TypeMismatch sample code for org.omg.IOP.CodecPackage.TypeMismatch definition code for org.omg.IOP.CodecPackage.TypeMismatch 
Decodes the given byte array into an Any based on the given TypeCode and the encoding format effective for this Codec.

Parameters:
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.
Returns:
An Any containing the data from the decoded byte array.
Throws:
FormatMismatch - thrown if the byte array cannot be decoded into an Any.
TypeMismatch sample code for org.omg.IOP.CodecPackage.TypeMismatch definition code for org.omg.IOP.CodecPackage.TypeMismatch