public override unsafe string ToString()
{
byte* bytes = stackalloc byte[1 * this.m_StringHeapByteLength];
byte* pStringHeap = (byte*) this.m_pStringHeap;
for (int i = 0; i < this.m_StringHeapByteLength; i++)
{
bytes[i] = pStringHeap[0];
pStringHeap++;
}
if (this.m_StringHeapByteLength == 0)
{
return "";
}
int charCount = Encoding.UTF8.GetCharCount(bytes, this.m_StringHeapByteLength);
char* chars = (char*) stackalloc byte[(2 * charCount)];
Encoding.UTF8.GetChars(bytes, this.m_StringHeapByteLength, chars, charCount);
return new string(chars, 0, charCount);
}
}