From 53d0267eca68e28ad9ca8a007cb3dbd9bf05340d Mon Sep 17 00:00:00 2001 From: morkt Date: Fri, 25 Jul 2014 00:52:24 +0400 Subject: [PATCH] (LittleEndian): added 64-bit integer readers. --- GameRes/Utility.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/GameRes/Utility.cs b/GameRes/Utility.cs index 73171e0c..d508ac95 100644 --- a/GameRes/Utility.cs +++ b/GameRes/Utility.cs @@ -70,6 +70,16 @@ namespace GameRes.Utility { return (int)ToUInt32 (value, index); } + + public static ulong ToUInt64 (byte[] value, int index) + { + return (ulong)ToUInt32 (value, index) | ((ulong)ToUInt32 (value, index+4) << 32); + } + + public static long ToInt64 (byte[] value, int index) + { + return (long)ToUInt64 (value, index); + } } public sealed class Crc32