uTools-Manuals/docs/java/org/omg/IOP/CodecOperations.html

225 lines
9.1 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="header">
<div class="subTitle">
org.omg.IOP
</div>
<h2 class="title" title="Interface CodecOperations">Interface CodecOperations</h2>
</div><div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>
All Known Subinterfaces:
</dt>
<dd>
<span><a href="../../../org/omg/IOP/Codec.html" title="接口在org.omg.IOP">Codec</a></span>
</dd>
</dl>
<hr/> <br/> <pre>public interface <span class="typeNameLabel">CodecOperations</span></pre>
<div class="block">
<span>ORB服务使用的IOR组件和服务上下文数据的格式通常定义为编码IDL定义数据类型实例的CDR封装。</span>
<span><code>Codec</code>提供了一种将这些组件在其IDL数据类型及其CDR封装表示之间传输的机制。</span>
<p> <span>A <code>Codec</code>是从<code>CodecFactory</code>获得的。</span> <span><code>CodecFactory</code>是通过电话<code>ORB.resolve_initial_references( "CodecFactory" )</code></span> </p>
</div> </li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- --> </a> <h3>方法摘要</h3>
<table border="0" cellpadding="3" cellspacing="0" class="memberSummary" summary="Method Summary table, listing methods, and an explanation">
<caption>
<span class="activeTableTab" id="t0"><span>所有方法</span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t2"><span><a href="javascript:show(2);">接口方法</a></span><span class="tabEnd"> </span></span>
<span class="tableTab" id="t3"><span><a href="javascript:show(4);">抽象方法</a></span><span class="tabEnd"> </span></span>
</caption>
<tbody>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor" id="i0">
<td class="colFirst"><code><a href="../../../org/omg/CORBA/Any.html" title="class in org.omg.CORBA">Any</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/omg/IOP/CodecOperations.html#decode_value-byte:A-org.omg.CORBA.TypeCode-">decode_value</a></span>(byte[] data, <a href="../../../org/omg/CORBA/TypeCode.html" title="class in org.omg.CORBA">TypeCode</a> tc)</code>
<div class="block">
根据给定的
<code>TypeCode</code>和对这个
<code>Codec</code>的编码格式,将给定的字节数组解码为
<code>Codec</code>
</div> </td>
</tr>
<tr class="rowColor" id="i1">
<td class="colFirst"><code><a href="../../../org/omg/CORBA/Any.html" title="class in org.omg.CORBA">Any</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/omg/IOP/CodecOperations.html#decode-byte:A-">decode</a></span>(byte[] data)</code>
<div class="block">
基于对该
<code>Codec</code>的编码格式,将给定的字节数组解码为
<code>Codec</code>
</div> </td>
</tr>
<tr class="altColor" id="i2">
<td class="colFirst"><code>byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/omg/IOP/CodecOperations.html#encode_value-org.omg.CORBA.Any-">encode_value</a></span>(<a href="../../../org/omg/CORBA/Any.html" title="class in org.omg.CORBA">Any</a> data)</code>
<div class="block">
基于对该编解码器有效的编码格式,将给定的任何数据转换为字节数组。
</div> </td>
</tr>
<tr class="rowColor" id="i3">
<td class="colFirst"><code>byte[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/omg/IOP/CodecOperations.html#encode-org.omg.CORBA.Any-">encode</a></span>(<a href="../../../org/omg/CORBA/Any.html" title="class in org.omg.CORBA">Any</a> data)</code>
<div class="block">
根据为此
<code>Codec</code>的编码格式,将给定的任何值转换为字节数组。
</div> </td>
</tr>
</tbody>
</table> </li>
</ul> </li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- --> </a> <h3>方法详细信息</h3> <a name="encode-org.omg.CORBA.Any-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>encode</h4> <pre>byte[] encode(<a href="../../../org/omg/CORBA/Any.html" title="class in org.omg.CORBA">Any</a> data)
throws <a href="../../../org/omg/IOP/CodecPackage/InvalidTypeForEncoding.html" title="class in org.omg.IOP.CodecPackage">InvalidTypeForEncoding</a></pre>
<div class="block">
可以把已知的任何成基于所述编码格式的字节数组有效用于该
<code>Codec</code>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>data</code> - 以任何形式编码为字节数组的数据。
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
<span>一个字节数组包含编码的Any。</span>
<span>该字节数组包含<code>TypeCode</code>和类型的数据。</span>
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code>InvalidTypeForEncoding</code> - 如果该类型对于此
<code>Codec</code>有效的编码格式无效,则
<code>Codec</code>
</dd>
</dl> </li>
</ul> <a name="decode-byte:A-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>decode</h4> <pre><a href="../../../org/omg/CORBA/Any.html" title="class in org.omg.CORBA">Any</a> decode(byte[] data)
throws <a href="../../../org/omg/IOP/CodecPackage/FormatMismatch.html" title="class in org.omg.IOP.CodecPackage">FormatMismatch</a></pre>
<div class="block">
基于对该
<code>Codec</code>的编码格式,将给定的字节数组解码为
<code>Codec</code>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>data</code> - 以字节数组的形式将要解码为Any的数据。
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
An包含来自解码字节数组的数据。
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code>FormatMismatch</code> - 如果字节数组不能解码成
<code>FormatMismatch</code> ,则抛出。
</dd>
</dl> </li>
</ul> <a name="encode_value-org.omg.CORBA.Any-">
<!-- --> </a>
<ul class="blockList">
<li class="blockList"> <h4>encode_value</h4> <pre>byte[] encode_value(<a href="../../../org/omg/CORBA/Any.html" title="class in org.omg.CORBA">Any</a> data)
throws <a href="../../../org/omg/IOP/CodecPackage/InvalidTypeForEncoding.html" title="class in org.omg.IOP.CodecPackage">InvalidTypeForEncoding</a></pre>
<div class="block">
<span>基于对该编解码器有效的编码格式,将给定的任何数据转换为字节数组。</span>
<span>只有来自Any的数据被编码而不是<code>TypeCode</code></span>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>data</code> - 将要编码为字节数组的以Any形式的数据。
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
一个包含来自编码任何数据的字节数组。
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code>InvalidTypeForEncoding</code> - 如果该类型对于Codec有效的编码格式无效
<code>Codec</code>
</dd>
</dl> </li>
</ul> <a name="decode_value-byte:A-org.omg.CORBA.TypeCode-">
<!-- --> </a>
<ul class="blockListLast">
<li class="blockList"> <h4>decode_value</h4> <pre><a href="../../../org/omg/CORBA/Any.html" title="class in org.omg.CORBA">Any</a> decode_value(byte[] data,
<a href="../../../org/omg/CORBA/TypeCode.html" title="class in org.omg.CORBA">TypeCode</a> tc)
throws <a href="../../../org/omg/IOP/CodecPackage/FormatMismatch.html" title="class in org.omg.IOP.CodecPackage">FormatMismatch</a>,
<a href="../../../org/omg/IOP/CodecPackage/TypeMismatch.html" title="class in org.omg.IOP.CodecPackage">TypeMismatch</a></pre>
<div class="block">
根据给定的
<code>TypeCode</code>和对该
<code>TypeCode</code>的编码格式,将给定的字节数组解码为
<code>Codec</code>
</div>
<dl>
<dt>
<span class="paramLabel">参数</span>
</dt>
<dd>
<code>data</code> - 以字节数组的形式将要解码为Any的数据。
</dd>
<dd>
<code>tc</code> - 用于解码数据的TypeCode。
</dd>
<dt>
<span class="returnLabel">结果</span>
</dt>
<dd>
An包含来自解码字节数组的数据。
</dd>
<dt>
<span class="throwsLabel">异常</span>
</dt>
<dd>
<code>FormatMismatch</code> - 如果字节数组不能解码成Any则抛出。
</dd>
<dd>
<code><a href="../../../org/omg/IOP/CodecPackage/TypeMismatch.html" title="class in org.omg.IOP.CodecPackage">TypeMismatch</a></code>
</dd>
</dl> </li>
</ul> </li>
</ul> </li>
</ul>
</div>
</div>