diff --git a/GameRes/ArcView.cs b/GameRes/ArcView.cs index d5e76d9e..10093ca5 100644 --- a/GameRes/ArcView.cs +++ b/GameRes/ArcView.cs @@ -365,6 +365,18 @@ namespace GameRes return total; } + /// + /// Read bytes starting from into byte array and return that array. + /// Returned array could be less than bytes length if end of the mapped file was reached. + /// + 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);