Click or drag to resize

Int24 Structure

Represents a 3-byte, 24-bit signed integer.
Inheritance Hierarchy
SystemObject
  SystemValueType
    GSFInt24

Namespace: GSF
Assembly: GSF.Core (in GSF.Core.dll) Version: 2.4.177-beta
Syntax
View Source

The Int24 type exposes the following members.

Constructors
 NameDescription
Public methodInt24(Int24)Creates 24-bit signed integer from an existing 24-bit signed integer.
Public methodInt24(Int32)Creates 24-bit signed integer from a 32-bit signed integer.
Public methodInt24(Byte, Int32)Creates 24-bit signed integer from three bytes at a specified position in a byte array.
Top
Methods
 NameDescription
Public methodCompareTo(Int24) Compares this instance to a specified 24-bit signed integer and returns an indication of their relative values.
Public methodCompareTo(Int32) Compares this instance to a specified 32-bit signed integer and returns an indication of their relative values.
Public methodCompareTo(Object) Compares this instance to a specified object and returns an indication of their relative values.
Public methodEquals(Int24) Returns a value indicating whether this instance is equal to a specified Int24 value.
Public methodEquals(Int32) Returns a value indicating whether this instance is equal to a specified Int32 value.
Public methodEquals(Object) Returns a value indicating whether this instance is equal to a specified object.
(Overrides ValueTypeEquals(Object))
Public methodGetBytesReturns the Int24 value as an array of three bytes.
Public methodStatic memberGetBytes(Int24)Returns the specified Int24 value as an array of three bytes.
Public methodGetHashCode Returns the hash code for this instance.
(Overrides ValueTypeGetHashCode)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodGetTypeCode Returns the System.TypeCode for value type System.Int32 (there is no defined type code for an Int24).
Public methodStatic memberGetValueReturns a 24-bit signed integer from three bytes at a specified position in a byte array.
Public methodStatic memberParse(String) Converts the string representation of a number to its 24-bit signed integer equivalent.
Public methodStatic memberParse(String, NumberStyles) Converts the string representation of a number in a specified style to its 24-bit signed integer equivalent.
Public methodStatic memberParse(String, IFormatProvider) Converts the string representation of a number in a specified culture-specific format to its 24-bit signed integer equivalent.
Public methodStatic memberParse(String, NumberStyles, IFormatProvider) Converts the string representation of a number in a specified style and culture-specific format to its 24-bit signed integer equivalent.
Public methodToString Converts the numeric value of this instance to its equivalent string representation.
(Overrides ValueTypeToString)
Public methodToString(IFormatProvider) Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information.
Public methodToString(String) Converts the numeric value of this instance to its equivalent string representation, using the specified format.
Public methodToString(String, IFormatProvider) Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information.
Public methodStatic memberTryParse(String, Int24) Converts the string representation of a number to its 24-bit signed integer equivalent. A return value indicates whether the conversion succeeded or failed.
Public methodStatic memberTryParse(String, NumberStyles, IFormatProvider, Int24) Converts the string representation of a number in a specified style and culture-specific format to its 24-bit signed integer equivalent. A return value indicates whether the conversion succeeded or failed.
Top
Operators
 NameDescription
Public operatorStatic memberAddition(Int24, Int24) Returns computed sum of values.
Public operatorStatic memberAddition(Int24, Int32) Returns computed sum of values.
Public operatorStatic memberAddition(Int32, Int24) Returns computed sum of values.
Public operatorStatic memberBitwiseAnd(Int24, Int24) Returns logical bitwise AND of values.
Public operatorStatic memberBitwiseAnd(Int24, Int32) Returns logical bitwise AND of values.
Public operatorStatic memberBitwiseAnd(Int32, Int24) Returns logical bitwise AND of values.
Public operatorStatic memberBitwiseOr(Int24, Int24) Returns logical bitwise OR of values.
Public operatorStatic memberBitwiseOr(Int24, Int32) Returns logical bitwise OR of values.
Public operatorStatic memberBitwiseOr(Int32, Int24) Returns logical bitwise OR of values.
Public operatorStatic memberDecrement(Int24) Returns decremented value.
Public operatorStatic memberDivision(Int24, Int24) Returns computed division of values.
Public operatorStatic memberDivision(Int24, Int32) Returns computed division of values.
Public operatorStatic memberDivision(Int32, Int24) Returns computed division of values.
Public operatorStatic memberEquality(Int24, Int24) Compares the two values for equality.
Public operatorStatic memberEquality(Int24, Int32) Compares the two values for equality.
Public operatorStatic memberEquality(Int32, Int24) Compares the two values for equality.
Public operatorStatic memberExclusiveOr(Int24, Int24) Returns logical bitwise exclusive-OR of values.
Public operatorStatic memberExclusiveOr(Int24, Int32) Returns logical bitwise exclusive-OR of values.
Public operatorStatic memberExclusiveOr(Int32, Int24) Returns logical bitwise exclusive-OR of values.
Public operatorStatic member(Decimal to Int24) Explicitly converts value to an Int24.
Public operatorStatic member(Double to Int24) Explicitly converts value to an Int24.
Public operatorStatic member(Enum to Int24) Explicitly converts value to an Int24.
Public operatorStatic member(Int24 to Byte) Explicitly converts Int24 to Byte.
Public operatorStatic member(Int24 to Int16) Explicitly converts Int24 to Int16.
Public operatorStatic member(Int24 to UInt16) Explicitly converts Int24 to UInt16.
Public operatorStatic member(Int32 to Int24) Explicitly converts value to an Int24.
Public operatorStatic member(Int64 to Int24) Explicitly converts value to an Int24.
Public operatorStatic member(Single to Int24) Explicitly converts value to an Int24.
Public operatorStatic member(String to Int24) Explicitly converts value to an Int24.
Public operatorStatic memberExponent(Int24, Int24) Returns result of first value raised to power of second value.
Public operatorStatic memberExponent(Int24, Int32) Returns result of first value raised to power of second value.
Public operatorStatic memberExponent(Int32, Int24) Returns result of first value raised to power of second value.
Public operatorStatic memberFalse(Int24) Returns true if value is equal to zero.
Public operatorStatic memberGreaterThan(Int24, Int24) Returns true if left value is greater than right value.
Public operatorStatic memberGreaterThan(Int24, Int32) Returns true if left value is greater than right value.
Public operatorStatic memberGreaterThan(Int32, Int24) Returns true if left value is greater than right value.
Public operatorStatic memberGreaterThanOrEqual(Int24, Int24) Returns true if left value is greater than or equal to right value.
Public operatorStatic memberGreaterThanOrEqual(Int24, Int32) Returns true if left value is greater than or equal to right value.
Public operatorStatic memberGreaterThanOrEqual(Int32, Int24) Returns true if left value is greater than or equal to right value.
Public operatorStatic member(Byte to Int24) Implicitly converts value to an Int24.
Public operatorStatic member(Char to Int24) Implicitly converts value to an Int24.
Public operatorStatic member(Int16 to Int24) Implicitly converts value to an Int24.
Public operatorStatic member(Int24 to Decimal) Implicitly converts Int24 to Decimal.
Public operatorStatic member(Int24 to Double) Implicitly converts Int24 to Double.
Public operatorStatic member(Int24 to Int32) Implicitly converts Int24 to Int32.
Public operatorStatic member(Int24 to Int64) Implicitly converts Int24 to Int64.
Public operatorStatic member(Int24 to Single) Implicitly converts Int24 to Single.
Public operatorStatic member(Int24 to String) Implicitly converts Int24 to String.
Public operatorStatic member(Int24 to UInt32) Implicitly converts Int24 to UInt32.
Public operatorStatic member(Int24 to UInt64) Implicitly converts Int24 to UInt64.
Public operatorStatic memberIncrement(Int24) Returns incremented value.
Public operatorStatic memberInequality(Int24, Int24) Compares the two values for inequality.
Public operatorStatic memberInequality(Int24, Int32) Compares the two values for inequality.
Public operatorStatic memberInequality(Int32, Int24) Compares the two values for inequality.
Public operatorStatic memberLeftShift(Int24, Int32) Returns value after left shifts of first value by the number of bits specified by second value.
Public operatorStatic memberLessThan(Int24, Int24) Returns true if left value is less than right value.
Public operatorStatic memberLessThan(Int24, Int32) Returns true if left value is less than right value.
Public operatorStatic memberLessThan(Int32, Int24) Returns true if left value is less than right value.
Public operatorStatic memberLessThanOrEqual(Int24, Int24) Returns true if left value is less or equal to than right value.
Public operatorStatic memberLessThanOrEqual(Int24, Int32) Returns true if left value is less or equal to than right value.
Public operatorStatic memberLessThanOrEqual(Int32, Int24) Returns true if left value is less or equal to than right value.
Public operatorStatic memberModulus(Int24, Int24) Returns computed remainder after dividing first value by the second.
Public operatorStatic memberModulus(Int24, Int32) Returns computed remainder after dividing first value by the second.
Public operatorStatic memberModulus(Int32, Int24) Returns computed remainder after dividing first value by the second.
Public operatorStatic memberMultiply(Int24, Int24) Returns computed product of values.
Public operatorStatic memberMultiply(Int24, Int32) Returns computed product of values.
Public operatorStatic memberMultiply(Int32, Int24) Returns computed product of values.
Public operatorStatic memberOnesComplement(Int24) Returns bitwise complement of value.
Public operatorStatic memberRightShift(Int24, Int32) Returns value after right shifts of first value by the number of bits specified by second value.
Public operatorStatic memberSubtraction(Int24, Int24) Returns computed difference of values.
Public operatorStatic memberSubtraction(Int24, Int32) Returns computed difference of values.
Public operatorStatic memberSubtraction(Int32, Int24) Returns computed difference of values.
Public operatorStatic memberTrue(Int24) Returns true if value is not zero.
Top
Fields
 NameDescription
Public fieldStatic memberBitMaskHigh byte bit-mask used when a 24-bit integer is stored within a 32-bit integer. This field is constant.
Public fieldStatic memberMaxValue Represents the largest possible value of an Int24. This field is constant.
Public fieldStatic memberMinValue Represents the smallest possible value of an Int24. This field is constant.
Top
Extension Methods
 NameDescription
Public Extension MethodBitRotL Performs rightwise bit-rotation for the specified number of rotations.
(Defined by BitExtensions)
Public Extension MethodBitRotR Performs rightwise bit-rotation for the specified number of rotations.
(Defined by BitExtensions)
Public Extension MethodCheckBits Determines if specified bits are set.
(Defined by BitExtensions)
Public Extension MethodCheckBits Determines if specified bits are set.
(Defined by BitExtensions)
Public Extension MethodCheckBits Determines if specified bits are set.
(Defined by BitExtensions)
Public Extension MethodCheckBits Determines if specified bits are set.
(Defined by BitExtensions)
Public Extension MethodClearBits Returns value with specified bits cleared.
(Defined by BitExtensions)
Public Extension MethodClearBits Returns value with specified bits cleared.
(Defined by BitExtensions)
Public Extension MethodGetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetEnumValueOrDefaultT Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
Public Extension MethodGetMaskedValue Returns value stored in the bits represented by the specified bitmask.
(Defined by BitExtensions)
Public Extension MethodGetMaskedValue Returns value stored in the bits represented by the specified bitmask.
(Defined by BitExtensions)
Public Extension MethodSetBits Returns value with specified bits set.
(Defined by BitExtensions)
Public Extension MethodSetBits Returns value with specified bits set.
(Defined by BitExtensions)
Public Extension MethodSetMaskedValue Returns value after setting a new value for the bits specified by the bitmask.
(Defined by BitExtensions)
Public Extension MethodSetMaskedValue Returns value after setting a new value for the bits specified by the bitmask.
(Defined by BitExtensions)
Public Extension MethodToBinaryString Encodes value as binary, i.e., a string of bit values (0 or 1).
(Defined by BitExtensions)
Public Extension MethodToggleBits Returns value with specified bits toggled.
(Defined by BitExtensions)
Public Extension MethodToggleBits Returns value with specified bits toggled.
(Defined by BitExtensions)
Top
Remarks

This class behaves like most other intrinsic signed integers but allows a 3-byte, 24-bit integer implementation that is often found in many digital-signal processing arenas and different kinds of protocol parsing. A signed 24-bit integer is typically used to save storage space on disk where its value range of -8388608 to 8388607 is sufficient, but the signed Int16 value range of -32768 to 32767 is too small.

This structure uses an Int32 internally for storage and most other common expected integer functionality, so using a 24-bit integer will not save memory. However, if the 24-bit signed integer range (-8388608 to 8388607) suits your data needs you can save disk space by only storing the three bytes that this integer actually consumes. You can do this by calling the Int24.GetBytes function to return a three byte binary array that can be serialized to the desired destination and then calling the Int24.GetValue function to restore the Int24 value from those three bytes.

All the standard operators for the Int24 have been fully defined for use with both Int24 and Int32 signed integers; you should find that without the exception Int24 can be compared and numerically calculated with an Int24 or Int32. Necessary casting should be minimal and typical use should be very simple - just as if you are using any other native signed integer.

See Also

Reference

GSF Namespace