FileDocCategorySizeDatePackage
CodecOperations.javaAPI DocJava SE 6 API3381Tue Jun 10 01:33:18 BST 2008org.omg.IOP

CodecOperations

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

Fields Summary
Constructors Summary
Methods Summary
public org.omg.CORBA.Anydecode(byte[] data)
Decodes the given byte array into an Any based on the encoding format effective for this Codec.

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.

public org.omg.CORBA.Anydecode_value(byte[] data, 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.

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.

public byte[]encode(org.omg.CORBA.Any data)
Converts the given any into a byte array based on the encoding format effective for this Codec.

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 TypeCode and the data of the type.
exception
InvalidTypeForEncoding thrown if the type is not valid for the encoding format effective for this Codec.

public byte[]encode_value(org.omg.CORBA.Any data)
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.

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 Codec.