-
- 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. TheCodec
provides a mechanism to transfer these components between their IDL data types and their CDR encapsulation representations.A
Codec
is obtained from theCodecFactory
. TheCodecFactory
is obtained through a call toORB.resolve_initial_references( "CodecFactory" )
.
-
-
Method Summary
Methods Modifier and Type Method and Description Any
decode_value(byte[] data, TypeCode tc)
Decodes the given byte array into an Any based on the givenTypeCode
and the encoding format effective for thisCodec
.Any
decode(byte[] data)
Decodes the given byte array into an Any based on the encoding format effective for thisCodec
.byte[]
encode_value(Any data)
Converts the given any into a byte array based on the encoding format effective for this Codec.byte[]
encode(Any data)
Converts the given any into a byte array based on the encoding format effective for thisCodec
.
-
-
-
Method Detail
-
encode
byte[] encode(Any data) throws InvalidTypeForEncoding
Converts the given any into a byte array based on the encoding format effective for thisCodec
.- 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 thisCodec
.
-
decode
Any decode(byte[] data) throws FormatMismatch
Decodes the given byte array into an Any based on the encoding format effective for thisCodec
.- 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
byte[] encode_value(Any data) throws 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 theTypeCode
.- 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
Any decode_value(byte[] data, TypeCode tc) throws FormatMismatch, TypeMismatch
Decodes the given byte array into an Any based on the givenTypeCode
and the encoding format effective for thisCodec
.- 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
-
-
Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-org/omg/iop/codecoperations.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.