当前位置: 首页>>代码示例>>Java>>正文


Java Encoding类代码示例

本文整理汇总了Java中org.omg.IOP.Encoding的典型用法代码示例。如果您正苦于以下问题:Java Encoding类的具体用法?Java Encoding怎么用?Java Encoding使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Encoding类属于org.omg.IOP包,在下文中一共展示了Encoding类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: create_codec

import org.omg.IOP.Encoding; //导入依赖的package包/类
/**
 * Creates a codec of the given encoding.  The only format recognized
 * by this factory is ENCODING_CDR_ENCAPS, versions 1.0 through
 * 1.(MAX_MINOR_VERSION_SUPPORTED).
 *
 * @exception UnknownEncoding Thrown if this factory cannot create a
 *   Codec of the given encoding.
 */
public Codec create_codec ( Encoding enc )
    throws UnknownEncoding
{
    if( enc == null ) nullParam();

    Codec result = null;

    // This is the only format we can currently create codecs for:
    if( (enc.format == ENCODING_CDR_ENCAPS.value) &&
        (enc.major_version == 1) )
    {
        if( (enc.minor_version >= 0) &&
            (enc.minor_version <= MAX_MINOR_VERSION_SUPPORTED) )
        {
            result = codecs[enc.minor_version];
        }
    }

    if( result == null ) {
        throw new UnknownEncoding();
    }

    return result;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:33,代码来源:CodecFactoryImpl.java

示例2: create_codec

import org.omg.IOP.Encoding; //导入依赖的package包/类
/**
 * Creates the Codec for the given encoding.
 *
 * @param for_encoding the encoding for that the Codec must be created.
 *
 * @return the suitable Codec.
 *
 * @throws UnknownEncoding if the encoding is not a ENCODING_CDR_ENCAPS.
 */
public Codec create_codec(Encoding for_encoding) throws UnknownEncoding
{
  if (for_encoding.format != ENCODING_CDR_ENCAPS.value)
    throw new UnknownEncoding("Only ENCODING_CDR_ENCAPS is " +
      "supported by this factory."
    );

  return new CdrEncapsCodecImpl(orb,
    new Version(for_encoding.major_version, for_encoding.minor_version)
  );
}
 
开发者ID:vilie,项目名称:javify,代码行数:21,代码来源:gnuCodecFactory.java

示例3: init_codec

import org.omg.IOP.Encoding; //导入依赖的package包/类
/**
 * Gets the Codec reference from the ORB.
 */
private void init_codec() throws CannotProceed
{
  try {
  CodecFactory factory = 
    CodecFactoryHelper.narrow(orb.resolve_initial_references("CodecFactory"));
  
  Encoding coding = 
    new Encoding(org.omg.IOP.ENCODING_CDR_ENCAPS.value,(byte)1,(byte)2);
  
  codec = factory.create_codec(coding);
  } catch (Throwable th) {
    throw new CannotProceed(th.toString());
  }
}
 
开发者ID:AlvaroVega,项目名称:TIDNamingJ,代码行数:18,代码来源:ConfFile.java


注:本文中的org.omg.IOP.Encoding类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。