Aegis.IO.StreamBuffer.GetStringAsUtf8 C# (CSharp) Method

GetStringAsUtf8() public method

public GetStringAsUtf8 ( ) : string
return string
        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;
        }

Same methods

StreamBuffer::GetStringAsUtf8 ( int readIndex ) : string