C# Class ZiadSpace.Util.BitHelper

Mostra file Open project: emist/Eryan

Public Methods

Method Description
BitHelper ( ) : System

Private constructor

ChangeBit ( byte pInput, int pPosition ) : byte

Changes the value of the bit at the specified positon

ChangeBit ( int pInput, int pPosition ) : int

Changes the value of the bit at the specified positon

ChangeBit ( long pInput, int pPosition ) : long

Changes the value of the bit at the specified positon

ChangeBit ( short pInput, int pPosition ) : short

Changes the value of the bit at the specified positon

ChangeSign ( int pInputValue ) : int

Changes the value from positive to negative and vis versa

ChangeSign ( long pInputValue ) : long

Changes the value from positive to negative and vis versa

ChangeSign ( short pInputValue ) : short

Changes the value from positive to negative and vis versa

GetBits ( byte pInput, int pStartIndex ) : byte

Gets the bits from a number as a number.

GetBits ( byte pInput, int pStartIndex, bool pShift ) : byte

Gets the bits.

GetBits ( byte pInput, int pStartIndex, int pLength ) : byte

Gets the bits.

GetBits ( byte pInput, int pStartIndex, int pLength, bool pShift ) : byte

Gets a number in the specified range of bits

GetBits ( int pInput, int pStartIndex ) : int

Gets the bits from a number as a number.

GetBits ( int pInput, int pStartIndex, bool pShift ) : int

Gets the bits.

GetBits ( int pInput, int pStartIndex, int pLength ) : int

Gets the bits.

GetBits ( int pInput, int pStartIndex, int pLength, bool pShift ) : int

Gets a number in the specified range of bits

GetBits ( long pInput, int pStartIndex ) : long

Gets the bits from a number as a number.

GetBits ( long pInput, int pStartIndex, bool pShift ) : long

Gets the bits.

GetBits ( long pInput, int pStartIndex, int pLength ) : long

Gets the bits.

GetBits ( long pInput, int pStartIndex, int pLength, bool pShift ) : long

Gets a number in the specified range of bits

GetBits ( short pInput, int pStartIndex ) : short

Gets the bits from a number as a number.

GetBits ( short pInput, int pStartIndex, bool pShift ) : short

Gets the bits.

GetBits ( short pInput, int pStartIndex, int pLength ) : short

Gets the bits.

GetBits ( short pInput, int pStartIndex, int pLength, bool pShift ) : short

Gets a number in the specified range of bits

HiByte ( short pWord ) : byte

The return value is the high-order byte of the specified value.

HiDword ( long pDWord ) : int

The return value is the high-order double word of the specified value.

HiWord ( int pDWord ) : short

The return value is the high-order word of the specified value.

IsBitSet ( byte pInput, int pPosition ) : bool

Determines whether [is bit set] [the specified p input].

IsBitSet ( int pInput, int pPosition ) : bool

Determines whether [is bit set] [the specified p input].

IsBitSet ( long pInput, int pPosition ) : bool

Determines whether [is bit set] [the specified p input].

IsBitSet ( short pInput, int pPosition ) : bool

Determines whether [is bit set] [the specified p input].

IsNegative ( int pInputValue ) : bool

Checks to see if number is less than 0.

IsNegative ( long pInputValue ) : bool

Checks to see if number is less than 0.

IsNegative ( short pInputValue ) : bool

Checks to see if number is less than 0.

LoByte ( short pWord ) : byte

The return value is the low-order byte of the specified value.

LoDword ( long pDWord ) : int

The return value is the low-order word of the specified value.

LoWord ( int pDWord ) : short

The return value is the low-order word of the specified value.

MakeDword ( short pValueLow, short pValueHigh ) : int

Makes a 32 bit integer from two 16 bit shorts

MakeLong ( int pValueLow, int pValueHigh ) : long

Makes a 64 bit long from two 32 bit integers

MakeWord ( byte pValueLow, byte pValueHigh ) : short

Makes a 16 bit short from two bytes

SetBit ( byte pInput, int pPosition, bool pOn ) : byte

Sets the value of a bit

SetBit ( int pInput, int pPosition, bool pOn ) : int

Sets the value of a bit

SetBit ( long pInput, int pPosition, bool pOn ) : long

Sets the value of a bit

SetBit ( short pInput, int pPosition, bool pOn ) : short

Sets the value of a bit

SetBits ( byte pDest, byte pSource, int pSourceIndex ) : byte

Sets the bits.

SetBits ( byte pDest, byte pSource, int pSourceIndex, int pLength ) : byte

Sets the bits.

SetBits ( byte pDest, byte pSource, int pSourceIndex, int pDestIndex, int pLength ) : byte

Sets the bits.

SetBits ( int pDest, int pSource, int pSourceIndex ) : int

Sets the bits.

SetBits ( int pDest, int pSource, int pSourceIndex, int pLength ) : int

Sets the bits.

SetBits ( int pDest, int pSource, int pSourceIndex, int pDestIndex, int pLength ) : int

Sets the bits.

SetBits ( short pDest, short pSource, int pSourceIndex, int pLength ) : int

Sets the bits.

SetBits ( long pDest, long pSource, int pSourceIndex ) : long

Sets the bits.

SetBits ( long pDest, long pSource, int pSourceIndex, int pLength ) : long

Sets the bits.

SetBits ( long pDest, long pSource, int pSourceIndex, int pDestIndex, int pLength ) : long

Sets the bits.

SetBits ( short pDest, short pSource, int pSourceIndex ) : short

Sets the bits.

SetBits ( short pDest, short pSource, int pSourceIndex, int pDestIndex, int pLength ) : short

Sets the bits.

SizeOf ( byte pInput ) : int

Gets the size of the input value in bits

SizeOf ( int pInput ) : int

Gets the size of the input value in bits

SizeOf ( long pInput ) : int

Gets the size of the input value in bits

SizeOf ( short pInput ) : int

Gets the size of the input value in bits

Method Details

BitHelper() public method

Private constructor
public BitHelper ( ) : System
return System

ChangeBit() public static method

Changes the value of the bit at the specified positon
public static ChangeBit ( byte pInput, int pPosition ) : byte
pInput byte
pPosition int
return byte

ChangeBit() public static method

Changes the value of the bit at the specified positon
public static ChangeBit ( int pInput, int pPosition ) : int
pInput int
pPosition int
return int

ChangeBit() public static method

Changes the value of the bit at the specified positon
public static ChangeBit ( long pInput, int pPosition ) : long
pInput long
pPosition int
return long

ChangeBit() public static method

Changes the value of the bit at the specified positon
public static ChangeBit ( short pInput, int pPosition ) : short
pInput short
pPosition int
return short

ChangeSign() public method

Changes the value from positive to negative and vis versa
public ChangeSign ( int pInputValue ) : int
pInputValue int The value
return int

ChangeSign() public method

Changes the value from positive to negative and vis versa
public ChangeSign ( long pInputValue ) : long
pInputValue long The value
return long

ChangeSign() public method

Changes the value from positive to negative and vis versa
public ChangeSign ( short pInputValue ) : short
pInputValue short The value
return short

GetBits() public static method

Gets the bits from a number as a number.
public static GetBits ( byte pInput, int pStartIndex ) : byte
pInput byte The input value.
pStartIndex int
return byte

GetBits() public static method

Gets the bits.
public static GetBits ( byte pInput, int pStartIndex, bool pShift ) : byte
pInput byte The p input.
pStartIndex int Start index of the p.
pShift bool if set to true [p shift].
return byte

GetBits() public static method

Gets the bits.
public static GetBits ( byte pInput, int pStartIndex, int pLength ) : byte
pInput byte The p input.
pStartIndex int Start index of the p.
pLength int Length of the p.
return byte

GetBits() public static method

Gets a number in the specified range of bits
public static GetBits ( byte pInput, int pStartIndex, int pLength, bool pShift ) : byte
pInput byte
pStartIndex int
pLength int
pShift bool
return byte

GetBits() public static method

Gets the bits from a number as a number.
public static GetBits ( int pInput, int pStartIndex ) : int
pInput int The input value.
pStartIndex int
return int

GetBits() public static method

Gets the bits.
public static GetBits ( int pInput, int pStartIndex, bool pShift ) : int
pInput int The p input.
pStartIndex int Start index of the p.
pShift bool if set to true [p shift].
return int

GetBits() public static method

Gets the bits.
public static GetBits ( int pInput, int pStartIndex, int pLength ) : int
pInput int The p input.
pStartIndex int Start index of the p.
pLength int Length of the p.
return int

GetBits() public static method

Gets a number in the specified range of bits
public static GetBits ( int pInput, int pStartIndex, int pLength, bool pShift ) : int
pInput int
pStartIndex int
pLength int
pShift bool
return int

GetBits() public static method

Gets the bits from a number as a number.
public static GetBits ( long pInput, int pStartIndex ) : long
pInput long The input value.
pStartIndex int
return long

GetBits() public static method

Gets the bits.
public static GetBits ( long pInput, int pStartIndex, bool pShift ) : long
pInput long The p input.
pStartIndex int Start index of the p.
pShift bool if set to true [p shift].
return long

GetBits() public static method

Gets the bits.
public static GetBits ( long pInput, int pStartIndex, int pLength ) : long
pInput long The p input.
pStartIndex int Start index of the p.
pLength int Length of the p.
return long

GetBits() public static method

Gets a number in the specified range of bits
public static GetBits ( long pInput, int pStartIndex, int pLength, bool pShift ) : long
pInput long
pStartIndex int
pLength int
pShift bool
return long

GetBits() public static method

Gets the bits from a number as a number.
public static GetBits ( short pInput, int pStartIndex ) : short
pInput short The input value.
pStartIndex int
return short

GetBits() public static method

Gets the bits.
public static GetBits ( short pInput, int pStartIndex, bool pShift ) : short
pInput short The p input.
pStartIndex int Start index of the p.
pShift bool if set to true [p shift].
return short

GetBits() public static method

Gets the bits.
public static GetBits ( short pInput, int pStartIndex, int pLength ) : short
pInput short The p input.
pStartIndex int Start index of the p.
pLength int Length of the p.
return short

GetBits() public static method

Gets a number in the specified range of bits
public static GetBits ( short pInput, int pStartIndex, int pLength, bool pShift ) : short
pInput short
pStartIndex int
pLength int
pShift bool
return short

HiByte() public static method

The return value is the high-order byte of the specified value.
public static HiByte ( short pWord ) : byte
pWord short The value
return byte

HiDword() public static method

The return value is the high-order double word of the specified value.
public static HiDword ( long pDWord ) : int
pDWord long
return int

HiWord() public static method

The return value is the high-order word of the specified value.
public static HiWord ( int pDWord ) : short
pDWord int
return short

IsBitSet() public static method

Determines whether [is bit set] [the specified p input].
public static IsBitSet ( byte pInput, int pPosition ) : bool
pInput byte The p input.
pPosition int The p position.
return bool

IsBitSet() public static method

Determines whether [is bit set] [the specified p input].
public static IsBitSet ( int pInput, int pPosition ) : bool
pInput int The p input.
pPosition int The p position.
return bool

IsBitSet() public static method

Determines whether [is bit set] [the specified p input].
public static IsBitSet ( long pInput, int pPosition ) : bool
pInput long The p input.
pPosition int The p position.
return bool

IsBitSet() public static method

Determines whether [is bit set] [the specified p input].
public static IsBitSet ( short pInput, int pPosition ) : bool
pInput short The p input.
pPosition int The p position.
return bool

IsNegative() public static method

Checks to see if number is less than 0.
public static IsNegative ( int pInputValue ) : bool
pInputValue int
return bool

IsNegative() public static method

Checks to see if number is less than 0.
public static IsNegative ( long pInputValue ) : bool
pInputValue long
return bool

IsNegative() public static method

Checks to see if number is less than 0.
public static IsNegative ( short pInputValue ) : bool
pInputValue short
return bool

LoByte() public static method

The return value is the low-order byte of the specified value.
public static LoByte ( short pWord ) : byte
pWord short The value
return byte

LoDword() public static method

The return value is the low-order word of the specified value.
public static LoDword ( long pDWord ) : int
pDWord long The value
return int

LoWord() public static method

The return value is the low-order word of the specified value.
public static LoWord ( int pDWord ) : short
pDWord int The value
return short

MakeDword() public static method

Makes a 32 bit integer from two 16 bit shorts
public static MakeDword ( short pValueLow, short pValueHigh ) : int
pValueLow short The low order value.
pValueHigh short The high order value.
return int

MakeLong() public static method

Makes a 64 bit long from two 32 bit integers
public static MakeLong ( int pValueLow, int pValueHigh ) : long
pValueLow int The low order value.
pValueHigh int The high order value.
return long

MakeWord() public static method

Makes a 16 bit short from two bytes
public static MakeWord ( byte pValueLow, byte pValueHigh ) : short
pValueLow byte The low order value.
pValueHigh byte The high order value.
return short

SetBit() public static method

Sets the value of a bit
public static SetBit ( byte pInput, int pPosition, bool pOn ) : byte
pInput byte The p input.
pPosition int The p position.
pOn bool if set to true [p on].
return byte

SetBit() public static method

Sets the value of a bit
public static SetBit ( int pInput, int pPosition, bool pOn ) : int
pInput int The p input.
pPosition int The p position.
pOn bool if set to true [p on].
return int

SetBit() public static method

Sets the value of a bit
public static SetBit ( long pInput, int pPosition, bool pOn ) : long
pInput long The p input.
pPosition int The p position.
pOn bool if set to true [p on].
return long

SetBit() public static method

Sets the value of a bit
public static SetBit ( short pInput, int pPosition, bool pOn ) : short
pInput short The p input.
pPosition int The p position.
pOn bool if set to true [p on].
return short

SetBits() public static method

Sets the bits.
public static SetBits ( byte pDest, byte pSource, int pSourceIndex ) : byte
pDest byte The p dest.
pSource byte The p source.
pSourceIndex int Index of the p source.
return byte

SetBits() public static method

Sets the bits.
public static SetBits ( byte pDest, byte pSource, int pSourceIndex, int pLength ) : byte
pDest byte The p dest.
pSource byte The p source.
pSourceIndex int Index of the p source.
pLength int Length of the p.
return byte

SetBits() public static method

Sets the bits.
public static SetBits ( byte pDest, byte pSource, int pSourceIndex, int pDestIndex, int pLength ) : byte
pDest byte The dest.
pSource byte The source.
pSourceIndex int Index of the source.
pDestIndex int Index of the dest.
pLength int Length to read.
return byte

SetBits() public static method

Sets the bits.
public static SetBits ( int pDest, int pSource, int pSourceIndex ) : int
pDest int The p dest.
pSource int The p source.
pSourceIndex int Index of the p source.
return int

SetBits() public static method

Sets the bits.
public static SetBits ( int pDest, int pSource, int pSourceIndex, int pLength ) : int
pDest int The p dest.
pSource int The p source.
pSourceIndex int Index of the p source.
pLength int Length of the p.
return int

SetBits() public static method

Sets the bits.
public static SetBits ( int pDest, int pSource, int pSourceIndex, int pDestIndex, int pLength ) : int
pDest int The dest.
pSource int The source.
pSourceIndex int Index of the source.
pDestIndex int Index of the dest.
pLength int Length to read.
return int

SetBits() public static method

Sets the bits.
public static SetBits ( short pDest, short pSource, int pSourceIndex, int pLength ) : int
pDest short The p dest.
pSource short The p source.
pSourceIndex int Index of the p source.
pLength int Length of the p.
return int

SetBits() public static method

Sets the bits.
public static SetBits ( long pDest, long pSource, int pSourceIndex ) : long
pDest long The p dest.
pSource long The p source.
pSourceIndex int Index of the p source.
return long

SetBits() public static method

Sets the bits.
public static SetBits ( long pDest, long pSource, int pSourceIndex, int pLength ) : long
pDest long The p dest.
pSource long The p source.
pSourceIndex int Index of the p source.
pLength int Length of the p.
return long

SetBits() public static method

Sets the bits.
public static SetBits ( long pDest, long pSource, int pSourceIndex, int pDestIndex, int pLength ) : long
pDest long The dest.
pSource long The source.
pSourceIndex int Index of the source.
pDestIndex int Index of the dest.
pLength int Length to read.
return long

SetBits() public static method

Sets the bits.
public static SetBits ( short pDest, short pSource, int pSourceIndex ) : short
pDest short The p dest.
pSource short The p source.
pSourceIndex int Index of the p source.
return short

SetBits() public static method

Sets the bits.
public static SetBits ( short pDest, short pSource, int pSourceIndex, int pDestIndex, int pLength ) : short
pDest short The dest.
pSource short The source.
pSourceIndex int Index of the source.
pDestIndex int Index of the dest.
pLength int Length to read.
return short

SizeOf() public static method

Gets the size of the input value in bits
public static SizeOf ( byte pInput ) : int
pInput byte The input value
return int

SizeOf() public static method

Gets the size of the input value in bits
public static SizeOf ( int pInput ) : int
pInput int The input value
return int

SizeOf() public static method

Gets the size of the input value in bits
public static SizeOf ( long pInput ) : int
pInput long The input value
return int

SizeOf() public static method

Gets the size of the input value in bits
public static SizeOf ( short pInput ) : int
pInput short The input value
return int