mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-23 19:34:15 +08:00
(ArcView.BytesEqual): new method.
This commit is contained in:
parent
716e6d27c8
commit
6c1b8641c2
@ -311,6 +311,22 @@ namespace GameRes
|
||||
throw new ArgumentException ("Not enough bytes to read in the memory mapped file view.", "offset");
|
||||
}
|
||||
|
||||
public bool BytesEqual (long offset, byte[] data)
|
||||
{
|
||||
if (Reserve (offset, (uint)data.Length) < (uint)data.Length)
|
||||
return false;
|
||||
unsafe
|
||||
{
|
||||
byte* ptr = m_mem + (offset - m_offset);
|
||||
for (int i = 0; i < data.Length; ++i)
|
||||
{
|
||||
if (ptr[i] != data[i])
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public bool AsciiEqual (long offset, string data)
|
||||
{
|
||||
if (Reserve (offset, (uint)data.Length) < (uint)data.Length)
|
||||
|
Loading…
x
Reference in New Issue
Block a user