Ejemplo n.º 1
0
    public int ArrayInt32Decode_1K_SBA()
    {
        var reader = new AmqpReader(EncodedInt32Array1K);

        reader.MoveNext();
        if (!reader.TryGetInt32Array(ScratchInt32Array, out int written))
        {
            throw new InvalidOperationException("buffer too small");
        }
        return(written);
    }
Ejemplo n.º 2
0
        public void ReadSpanInt32()
        {
            var reader = new AmqpReader(_encodedInt32_1M);

            Assert.True(reader.MoveNext() == AmqpToken.Array);
            Assert.AreEqual(AmqpToken.Array, reader.CurrentType);

            if (!reader.TryGetInt32Array(ScratchInt32Array, out int written))
            {
                throw new InvalidOperationException("buffer too small");
            }

            Assert.True(ScratchInt32Array.AsSpan(0, written).SequenceEqual(_randomInt32_1M));
        }