Class CDREncapsCodec
java.lang.Object
org.omg.CORBA.LocalObject
com.sun.corba.ee.impl.interceptors.CDREncapsCodec
- All Implemented Interfaces:
Serializable, Object, IDLEntity, Codec, CodecOperations
CDREncapsCodec is an implementation of Codec, as described
in orbos/99-12-02, that supports CDR encapsulation version 1.0, 1.1, and
1.2.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCDREncapsCodec(ORB orb, int major, int minor) Creates a new codec implementation. -
Method Summary
Modifier and TypeMethodDescriptiondecode(byte[] data) Decode the given octet sequence into an any based on a CDR encapsulated octet sequence.decode_value(byte[] data, TypeCode tc) Decode the given octet sequence into an any based on a CDR encapsulated octet sequence.byte[]Convert the given any into a CDR encapsulated octet sequencebyte[]encode_value(Any data) Convert the given any into a CDR encapsulated octet sequence.Methods inherited from class LocalObject
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface, _get_interface_def, _get_policy, _hash, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_policy_override, validate_connectionMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Object
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
-
Constructor Details
-
CDREncapsCodec
Creates a new codec implementation. Uses the given ORB to create CDRInputStreams when necessary.- Parameters:
orb- The ORB to use to create a CDRInputStream or CDROutputStreammajor- The major version of GIOP we are encoding forminor- The minor version of GIOP we are encoding for
-
-
Method Details
-
encode
Convert the given any into a CDR encapsulated octet sequence- Specified by:
encodein interfaceCodecOperations- 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
TypeCodeand the data of the type. - Throws:
InvalidTypeForEncoding- thrown if the type is not valid for the encoding format effective for thisCodec.
-
decode
Decode the given octet sequence into an any based on a CDR encapsulated octet sequence.- Specified by:
decodein interfaceCodecOperations- 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
Convert the given any into a CDR encapsulated octet sequence. Only the data is stored. The type code is not.- Specified by:
encode_valuein interfaceCodecOperations- 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 thisCodec.
-
decode_value
Decode the given octet sequence into an any based on a CDR encapsulated octet sequence. The type code is expected not to appear in the octet sequence, and the given type code is used instead.- Specified by:
decode_valuein interfaceCodecOperations- 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- thrown
-