示例#1
0
        public void CanReadLongAsShortStringEmpty()
        {
            ByteBuffer buffer = ByteBuffer.Allocate(0x1000);

            EncodingUtils.WriteShortStringBytes(buffer, "");
            buffer.Flip();
            long value = EncodingUtils.ReadLongAsShortString(buffer);

            Assert.AreEqual(0, value);
        }
示例#2
0
        public void CanReadLongAsShortStringNegative()
        {
            ByteBuffer buffer = ByteBuffer.Allocate(0x1000);

            EncodingUtils.WriteShortStringBytes(buffer, "-98878122");
            buffer.Flip();
            long value = EncodingUtils.ReadLongAsShortString(buffer);

            Assert.AreEqual(-98878122, value);
        }