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

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

            Assert.AreEqual(0, value);
        }
Exemple #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);
        }