mirror of
https://github.com/crskycode/GARbro.git
synced 2025-01-11 20:39:29 +08:00
(BigEndian): added ToUInt16 and ToInt16 methods.
This commit is contained in:
parent
3f900739f9
commit
bbadd583df
@ -108,6 +108,16 @@ namespace GameRes.Utility
|
|||||||
|
|
||||||
public static class BigEndian
|
public static class BigEndian
|
||||||
{
|
{
|
||||||
|
public static ushort ToUInt16 (byte[] value, int index)
|
||||||
|
{
|
||||||
|
return (ushort)(value[index] << 8 | value[index+1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static short ToInt16 (byte[] value, int index)
|
||||||
|
{
|
||||||
|
return (short)(value[index] << 8 | value[index+1]);
|
||||||
|
}
|
||||||
|
|
||||||
public static uint ToUInt32 (byte[] value, int index)
|
public static uint ToUInt32 (byte[] value, int index)
|
||||||
{
|
{
|
||||||
return (uint)(value[index] << 24 | value[index+1] << 16 | value[index+2] << 8 | value[index+3]);
|
return (uint)(value[index] << 24 | value[index+1] << 16 | value[index+2] << 8 | value[index+3]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user