C# Класс Nintenlord.Utility.ByteExtensions

Extensions for byte and arrays of it
Показать файл Открыть проект

Открытые методы

Метод Описание
And ( this array, byte array2 ) : byte[]
AndWith ( this array, byte array2 ) : void
Clamp ( this i, byte min, byte max ) : int
GetBits ( this i, int position, int length ) : byte
GetBits ( this i, int position, int length ) : byte[]
GetMask ( int position, int length ) : byte
GetMaskArray ( int position, int length ) : byte[]
IsInRange ( this i, byte min, byte max ) : bool
Neg ( this array ) : byte[]
NegWith ( this array ) : void
Or ( this array, byte array2 ) : byte[]
OrWith ( this array, byte array2 ) : void
Shift ( this i, int amount ) : byte
Shift ( this array, int toShift ) : byte[]

Shifts bytes in array. Assumes bytes are in little endian order and low priority bits are first

Could be made faster with using uints...

ToHexString ( this i, string prefix ) : string
ToString ( this i, int bytesPerWord ) : string
WriteTo ( this array, int destination, byte source, int length ) : void
Xor ( this array, byte array2 ) : byte[]
XorWith ( this array, byte array2 ) : void

Приватные методы

Метод Описание
ShiftLeft ( this array, int toShift ) : byte[]
ShiftRight ( this array, int toShift ) : byte[]

Описание методов

And() публичный статический Метод

public static And ( this array, byte array2 ) : byte[]
array this
array2 byte
Результат byte[]

AndWith() публичный статический Метод

public static AndWith ( this array, byte array2 ) : void
array this
array2 byte
Результат void

Clamp() публичный статический Метод

public static Clamp ( this i, byte min, byte max ) : int
i this
min byte
max byte
Результат int

GetBits() публичный статический Метод

public static GetBits ( this i, int position, int length ) : byte
i this
position int
length int
Результат byte

GetBits() публичный статический Метод

public static GetBits ( this i, int position, int length ) : byte[]
i this
position int
length int
Результат byte[]

GetMask() публичный статический Метод

public static GetMask ( int position, int length ) : byte
position int
length int
Результат byte

GetMaskArray() публичный статический Метод

public static GetMaskArray ( int position, int length ) : byte[]
position int
length int
Результат byte[]

IsInRange() публичный статический Метод

public static IsInRange ( this i, byte min, byte max ) : bool
i this
min byte
max byte
Результат bool

Neg() публичный статический Метод

public static Neg ( this array ) : byte[]
array this
Результат byte[]

NegWith() публичный статический Метод

public static NegWith ( this array ) : void
array this
Результат void

Or() публичный статический Метод

public static Or ( this array, byte array2 ) : byte[]
array this
array2 byte
Результат byte[]

OrWith() публичный статический Метод

public static OrWith ( this array, byte array2 ) : void
array this
array2 byte
Результат void

Shift() публичный статический Метод

public static Shift ( this i, int amount ) : byte
i this
amount int
Результат byte

Shift() публичный статический Метод

Shifts bytes in array. Assumes bytes are in little endian order and low priority bits are first
Could be made faster with using uints...
public static Shift ( this array, int toShift ) : byte[]
array this Array to shift
toShift int Positive means left shifting, negative right
Результат byte[]

ToHexString() публичный статический Метод

public static ToHexString ( this i, string prefix ) : string
i this
prefix string
Результат string

ToString() публичный статический Метод

public static ToString ( this i, int bytesPerWord ) : string
i this
bytesPerWord int
Результат string

WriteTo() публичный статический Метод

public static WriteTo ( this array, int destination, byte source, int length ) : void
array this
destination int
source byte
length int
Результат void

Xor() публичный статический Метод

public static Xor ( this array, byte array2 ) : byte[]
array this
array2 byte
Результат byte[]

XorWith() публичный статический Метод

public static XorWith ( this array, byte array2 ) : void
array this
array2 byte
Результат void