mirror of
https://github.com/lifegpc/GARbro.git
synced 2026-06-06 13:39:09 +08:00
(BigEndian): added ToUInt16 and ToInt16 methods.
This commit is contained in:
@@ -108,6 +108,16 @@ namespace GameRes.Utility
|
||||
|
||||
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)
|
||||
{
|
||||
return (uint)(value[index] << 24 | value[index+1] << 16 | value[index+2] << 8 | value[index+3]);
|
||||
|
||||
Reference in New Issue
Block a user