OTX Reference  
OpenTestSystem.Otx.Core.Terms.DecodeInteger Class Reference

Decodes an Integer More...

Inheritance diagram for OpenTestSystem.Otx.Core.Terms.DecodeInteger:
Inheritance graph

Public Attributes

Endianness byteOrder
 Specifies the byte order which be used when writing the encoded Integer value into the resulting ByteField. The most widely used byte order LITTLE-ENDIAN is the default. More...
 
ByteFieldTerm bytes
 Represents the ByteField value which shall be converted to Integer. More...
 
EncodingType encodingType
 Specifies how the Integer value be encoded. The most widely used encoding called two's complement is the default. More...
 
- Public Attributes inherited from OpenTestSystem.Otx.Core.Terms.Term
MetaData metaData
 Store additional More...
 

Detailed Description

Decodes an Integer

The DecodeInteger term returns the decoded Integer value of the ByteField argument.

The term provides control over the byte order which be used for decoding as well as the way how the ByteField be decoded regarding n-bit unsigned, n-bit signed binary or n-bit two's complement interpretation, where nis the ByteField's size multiplied by 8 (in other words: the total number of bits in the original ByteField).

Exceptions
Core.Exceptions.OutOfBoundsExceptionIt is thrown if the ByteField is empty or the value space of xsd:long could be exceeded (see Annex A). This happens if the ByteField's size is greater than 8 bytes, or when using UNSIGNED interpretation on an 8 byte ByteField in which the most significant bit is 1. An OutOfBoundsException shall also occur if the byte order is MIXED-ENDIAN and the ByteField size is odd.
Syntax
IntegerTerm = Conversion.DecodeInteger(EncodingType, Endianness, ByteFieldTerm);
Examples
// Local Declarations
Integer result;
// Flow
//Returns the result = -256
result = Conversion.DecodeInteger(@EncodingType:TWOSCOMPLEMENT, @Endianness:LITTLEENDIAN, &00 FF);

Member Data Documentation

◆ byteOrder

Endianness OpenTestSystem.Otx.Core.Terms.DecodeInteger.byteOrder

Specifies the byte order which be used when writing the encoded Integer value into the resulting ByteField. The most widely used byte order LITTLE-ENDIAN is the default.

◆ bytes

ByteFieldTerm OpenTestSystem.Otx.Core.Terms.DecodeInteger.bytes

Represents the ByteField value which shall be converted to Integer.

◆ encodingType

EncodingType OpenTestSystem.Otx.Core.Terms.DecodeInteger.encodingType

Specifies how the Integer value be encoded. The most widely used encoding called two's complement is the default.