mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-23 13:45:34 +08:00
(Binary.GetCString): new static method.
This commit is contained in:
parent
0aaf977c8a
commit
f5d2cac377
@ -24,6 +24,7 @@
|
||||
//
|
||||
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace GameRes.Utility
|
||||
{
|
||||
@ -83,6 +84,19 @@ namespace GameRes.Utility
|
||||
count -= preceding;
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetCString (byte[] data, int index, int length_limit, Encoding enc)
|
||||
{
|
||||
int name_length = 0;
|
||||
while (name_length < length_limit && 0 != data[index+name_length])
|
||||
name_length++;
|
||||
return enc.GetString (data, index, name_length);
|
||||
}
|
||||
|
||||
public static string GetCString (byte[] data, int index, int length_limit)
|
||||
{
|
||||
return GetCString (data, index, length_limit, Encodings.cp932);
|
||||
}
|
||||
}
|
||||
|
||||
public static class BigEndian
|
||||
|
Loading…
Reference in New Issue
Block a user