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

GetStringAsUtf16() public method

public GetStringAsUtf16 ( ) : string
return string
        public string GetStringAsUtf16()
        {
            int i, stringBytes = 0;
            for (i = ReadBytes; i < BufferSize; i += 2)
            {
                if (Buffer[i + 0] == 0
                    && Buffer[i + 1] == 0)
                    break;

                stringBytes += 2;

                if (ReadBytes + stringBytes + 2 > WrittenBytes)
                    throw new AegisException(AegisResult.BufferUnderflow, "No more readable buffer.");
            }

            //  String으로 변환할 때 Null terminate를 포함시켜서는 안된다.
            string val = Encoding.Unicode.GetString(Buffer, ReadBytes, stringBytes);
            ReadBytes += stringBytes + 2;
            return val;
        }

Same methods

StreamBuffer::GetStringAsUtf16 ( StreamBuffer source, int readIndex ) : string
StreamBuffer::GetStringAsUtf16 ( int readIndex ) : string