mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-24 20:04:13 +08:00
(ArcView.ReadBytes): new method.
This commit is contained in:
parent
65ae716469
commit
6c6c6be7a0
@ -365,6 +365,18 @@ namespace GameRes
|
||||
return total;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Read <paramref name="count"/> bytes starting from <paramref name="offset"/> into byte array and return that array.
|
||||
/// Returned array could be less than <paramref name="count"/> bytes length if end of the mapped file was reached.
|
||||
/// </summary>
|
||||
public byte[] ReadBytes (long offset, uint count)
|
||||
{
|
||||
count = Math.Min (count, Reserve (offset, count));
|
||||
var data = new byte[count];
|
||||
Read (offset, data, 0, count);
|
||||
return data;
|
||||
}
|
||||
|
||||
public byte ReadByte (long offset)
|
||||
{
|
||||
Reserve (offset, 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user