static private DecodeString ( byte buffer, int &index, bool unicode ) : string | ||
buffer | byte | |
index | int | |
unicode | bool | |
return | string |
static string DecodeString (byte[] buffer, ref int index, bool unicode)
{
var encoding = unicode ? Encoding.Unicode : Encoding.UTF8;
var length = BitConverterLE.ToInt16 (buffer, index);
var value = encoding.GetString (buffer, index + 2, length);
index += 2 + length;
return value;
}