本文整理汇总了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);
}
示例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 );
}
示例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;