public string GetStringAsUtf8()
{
int i, stringBytes = 0;
for (i = ReadBytes; i < BufferSize; ++i)
{
if (Buffer[i] == 0)
break;
++stringBytes;
if (i > WrittenBytes)
throw new AegisException(AegisResult.BufferUnderflow, "No more readable buffer.");
}
// String으로 변환할 때 Null terminate를 포함시켜서는 안된다.
string val = Encoding.UTF8.GetString(Buffer, ReadBytes, stringBytes);
ReadBytes += stringBytes + 1;
return val;
}