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


Java TypeMismatch类代码示例

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


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

示例1: decode_value

import org.omg.IOP.CodecPackage.TypeMismatch; //导入依赖的package包/类
/**
 * Decode the value, stored in the byte array, into Any, assuming,
 * that the byte array holds the data structure, defined by the
 * given typecode.
 *
 * The byte array may have the optional four byte length indicator
 * in the beginning. If these four bytes are zero, it is assumed,
 * that no length indicator is present.
 */
public Any decode_value(byte[] them, TypeCode type)
                 throws FormatMismatch, TypeMismatch
{
  try
    {
      checkTypePossibility("", type);
    }
  catch (InvalidTypeForEncoding ex)
    {
      throw new TypeMismatch(ex.getMessage());
    }

  BufferredCdrInput input = createInput(them);
  BufferredCdrInput encapsulation = createEncapsulation(them, input);
  return readAny(type, encapsulation);
}
 
开发者ID:vilie,项目名称:javify,代码行数:26,代码来源:CdrEncapsCodecImpl.java

示例2: decode_value

import org.omg.IOP.CodecPackage.TypeMismatch; //导入依赖的package包/类
/**
 * 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.
 */
public Any decode_value( byte[] data, TypeCode tc )
    throws FormatMismatch, TypeMismatch
{
    if( data == null )
        throw wrapper.nullParam() ;
    if( tc == null )
        throw  wrapper.nullParam() ;
    return decodeImpl( data, tc );
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:CDREncapsCodec.java

示例3: decode_value

import org.omg.IOP.CodecPackage.TypeMismatch; //导入依赖的package包/类
/**
 * Decode the given array of bytes, supposing that they contain the
 * given data structure, and return the decoded value.
 *
 * @param them the array of bytes to decode. Should contain the data type,
 * matching the structure, defined in the <code>type</code> parameter.
 * Does not contain the typecode itself.
 *
 * @param type the typecode of the data structure, stored in the byte
 * array.
 *
 * @return the {@link Any}, containing the decoded structure. The
 * structure can be extracted from the Any with the appropriate helper.
 *
 * @throws FormatMismatch on the invalid structure of the byte array.
 * @throws TypeMismatch if discovered that the the byte array defines a
 * different structure.
 *
 * @see #encode_value(Any)
 */
Any decode_value(byte[] them, TypeCode type)
          throws FormatMismatch, TypeMismatch;
 
开发者ID:vilie,项目名称:javify,代码行数:23,代码来源:CodecOperations.java


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