Пример #1
0
        public void Check_Data_Remaining_FixedLength_Unicode_LittleEndian(string str, int remains)
        {
            Span <byte> data = Encoding.Unicode.GetBytes(str);

            StackDataReader reader = new StackDataReader(data);

            reader.ReadUnicodeLE(str.Length);
            Assert.Equal(reader.Remaining, remains);

            reader.ReadUnicodeLE(remains);
            Assert.Equal(0, reader.Remaining);

            reader.Release();
        }
Пример #2
0
        public void Read_Unicode_LittleEndian(string str, string result)
        {
            Span <byte> data = Encoding.Unicode.GetBytes(str);

            StackDataReader reader = new StackDataReader(data);

            string s = reader.ReadUnicodeLE();

            Assert.Equal(s, result);

            reader.Release();
        }
Пример #3
0
        public void Read_Unicode_LittleEndian_With_FixedLength(string str, string result)
        {
            Span <byte> data = Encoding.Unicode.GetBytes(str);

            StackDataReader reader = new StackDataReader(data);

            string s = reader.ReadUnicodeLE(str.Length);

            Assert.Equal(s, result);
            Assert.Equal(0, reader.Remaining);

            reader.Release();
        }