Method | Description | |
---|---|---|
ByteArrayToString ( byte buffer ) : string |
Transfer a byte array to a binary string.
|
|
GetBytes ( System.DateTime value, bool isBigEndian ) : byte[] |
convert DateTime to bytes, the encoding is the seconds from 19700101
|
|
GetBytes ( byte buffer, int &index, int count ) : byte[] |
get bytes from bytes
|
|
GetBytes ( uint value, bool isBigEndian ) : byte[] |
convert value to bytes
|
|
GetBytes ( ushort value, bool isBigEndian ) : byte[] |
convert value to bytes
|
|
GetDateTime ( byte buffer, int &index, bool isBigEndian ) : System.DateTime |
Get UInt32 data from buffer, and transfer it to DateTime
|
|
GetUInt16 ( byte buffer, int &index, bool isBigEndian ) : ushort |
parse UInt16 from bytes
|
|
GetUInt32 ( byte buffer, int &index, bool isBigEndian ) : uint |
parse UInt32 from bytes
|
|
GetUInt64 ( byte buffer, int &index, bool isBigEndian ) : ulong |
parse UInt64 from bytes
|
|
ReverseByFlag ( bool isBigEndian, byte ret ) : void |
reverse the bytes if it's not big endian.
|
public static ByteArrayToString ( byte buffer ) : string | ||
buffer | byte | The input byte array |
return | string |
public static GetBytes ( System.DateTime value, bool isBigEndian ) : byte[] | ||
value | System.DateTime | a DateTime value |
isBigEndian | bool | order of bytes. If it's big endian, set it to true, else set it to false. |
return | byte[] |
public static GetBytes ( byte buffer, int &index, int count ) : byte[] | ||
buffer | byte | the buffer stores the value. |
index | int | the index of start to parse |
count | int | count of bytes |
return | byte[] |
public static GetBytes ( uint value, bool isBigEndian ) : byte[] | ||
value | uint | a UInt32 value |
isBigEndian | bool | order of bytes. If it's big endian, set it to true, else set it to false. |
return | byte[] |
public static GetBytes ( ushort value, bool isBigEndian ) : byte[] | ||
value | ushort | a UInt16 value |
isBigEndian | bool | order of bytes. If it's big endian, set it to true, else set it to false. |
return | byte[] |
public static GetDateTime ( byte buffer, int &index, bool isBigEndian ) : System.DateTime | ||
buffer | byte | the buffer stores the value. |
index | int | the index of start to parse |
isBigEndian | bool | order of bytes. If it's big endian, set it to true, else set it to false. |
return | System.DateTime |
public static GetUInt16 ( byte buffer, int &index, bool isBigEndian ) : ushort | ||
buffer | byte | the buffer stores the value. |
index | int | the index of start to parse |
isBigEndian | bool | order of bytes. If it's big endian, set it to true, else set it to false. |
return | ushort |
public static GetUInt32 ( byte buffer, int &index, bool isBigEndian ) : uint | ||
buffer | byte | the buffer stores the value. |
index | int | the index of start to parse |
isBigEndian | bool | order of bytes. If it's big endian, set it to true, else set it to false. |
return | uint |
public static GetUInt64 ( byte buffer, int &index, bool isBigEndian ) : ulong | ||
buffer | byte | the buffer stores the value. |
index | int | the index of start to parse |
isBigEndian | bool | order of bytes. If it's big endian, set it to true, else set it to false. |
return | ulong |
public static ReverseByFlag ( bool isBigEndian, byte ret ) : void | ||
isBigEndian | bool | order of bytes. If it's big endian, set it to true, else set it to false. |
ret | byte | the bytes will be re-order |
return | void |