VisiBroker for Java

org.omg.IOP
Interface CodecOperations

All Known Subinterfaces:
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 decode_value(byte[] data, TypeCode tc)
          This method decodes the given octet sequence into a CORBA.Any based on the given TypeCode and the encoding format effective for this Codec.
 Any decode(byte[] data)
          This method decodes the given octet sequence into a CORBA.Any object based on the encoding format effective for this Codec.
 byte[] encode_value(Any data)
          This method converts the given CORBA.Any object into an octet sequence based on the encoding format effective for this Codec.
 byte[] encode(Any data)
          This method converts the given data in the form of a CORBA.Any into an octet sequence based on the encoding format effective for this Codec.
 

Method Detail

decode_value

Any decode_value(byte[] data,
                 TypeCode tc)
                 throws FormatMismatch,
                        TypeMismatch
This method decodes the given octet sequence into a CORBA.Any based on the given TypeCode and the encoding format effective for this Codec. This method raises FormatMismatch if the octet sequence cannot be decoded into a CORBA.Any.

Parameters:
data - The data, in the form of an octet sequence, to be decoded into a CORBA.Any.
tc - The TypeCode to be used to decode the data.
Returns:
CORBA.Any decoded octet sequence in the form of Any.
Throws:
FormatMismatch - octet sequence cannot be decoded into CORBA.Any.
TypeMismatch - TypeCode does not match a given octet sequence.

encode_value

byte[] encode_value(Any data)
                    throws InvalidTypeForEncoding
This method converts the given CORBA.Any object into an octet sequence based on the encoding format effective for this Codec. Only the data from the CORBA.Any is encoded, not the TypeCode. This operation may raise InvalidTypeForEncoding.

Parameters:
data - An octet sequence containing the data from the encoded CORBA.Any.
Returns:
octet sequence corresponding to the Any data.
Throws:
InvalidTypeForEncoding - Invalid type is specified for encoding.

decode

Any decode(byte[] data)
           throws FormatMismatch
This method decodes the given octet sequence into a CORBA.Any object based on the encoding format effective for this Codec.

Parameters:
data - The data, in the form of an octet sequence, to be decoded into a CORBA.Any.
Returns:
CORBA.Any Object containing the decoded octet sequence.
Throws:
FormatMismatch - cannot be decoded into a CORBA.Any.

encode

byte[] encode(Any data)
              throws InvalidTypeForEncoding
This method converts the given data in the form of a CORBA.Any into an octet sequence based on the encoding format effective for this Codec. This octet sequence contains both the TypeCode and the data of the type. This operation may raise InvalidTypeForEncoding.

Parameters:
data - The data, in the form of a CORBA.Any, to be encoded into an octet sequence.
Returns:
Octet sequence containing the typecode and the data of the type.
Throws:
InvalidTypeForEncoding - Invalid type is specified for encoding.

Borland Software Corporation
http://www.borland.com
100 Enterprise Way
Scotts Valley, CA 95066
Voice: (831) 431-1000
pubsweb@borland.com

Read the latest documentation online