示例#1
0
        // ReSharper disable ParameterOnlyUsedForPreconditionCheck.Local
        static void ReadString(Encoding encoding, string value, string separator, string expected, int readerIndex)
        {
            byte[]      bytes  = encoding.GetBytes(value);
            IByteBuffer buffer = Unpooled.WrappedBuffer(bytes);

            bytes = encoding.GetBytes(separator);
            IByteBuffer buf = Unpooled.WrappedBuffer(bytes);

            string actual = ByteBufferUtil.ReadString(buffer, buf, encoding);

            Assert.Equal(readerIndex, buffer.ReaderIndex);
            Assert.Equal(expected, actual);
        }