Esempio n. 1
0
        /// <summary>
        /// Copies the Available bytes from buf into buffer as if by
        /// repeated execution of put( buf.Get() ).
        /// </summary>
        /// <param name="buf">the source of the bytes to put. All Available
        /// bytes are copied.</param>
        /// <returns>flex buffer object.</returns>
        /// Exception:
        ///     IOException if the buffer overflows its max length.

        public FlexBuffer Put(FlexBuffer buf)
        {
            int n = buf.Avail();

            Put(buf.buffer, buf.index, n);
            buf.Skip(n, false);
            return(this);
        }
Esempio n. 2
0
        public void Skip8()
        {
            buf = new FlexBuffer(new byte[] { 1, 2 });

            int max = 4 * 1024 * 1024;

            buf.Skip(max + 1, true);
            CheckBuf(max + 1, max + 1, 0);
        }
Esempio n. 3
0
        /// <summary>
        /// Copies the specified number of bytes from buf into buffer
        /// as if by repeated execution of Put( buf.Get() ).
        /// </summary>
        /// <param name="buf">the source of the bytes to put.</param>
        /// <param name="len"></param>len the number of bytes to put. Len must be
        /// less than or equal to buf.Avail().
        /// <returns>flex buffer object.</returns>
        /// Exception:
        ///     IOException if the buffer overflows its max length.

        public FlexBuffer Put(FlexBuffer buf, int len)
        {
            if (len > buf.Avail())
            {
                throw new ArgumentOutOfRangeException("len > buf.Avail()");
            }

            Put(buf.buffer, buf.index, len);
            buf.Skip(len, false);
            return(this);
        }
Esempio n. 4
0
 public void Skip7()
 {
     buf = new FlexBuffer(new byte[] { 1, 2 });
     buf.Skip(5, true);
     CheckBuf(5, 5, 0);
 }
Esempio n. 5
0
 public void Skip6()
 {
     buf = new FlexBuffer(new byte[] { 1, 2 });
     buf.Skip(1, true);
     CheckBuf(2, 1, 1);
 }
Esempio n. 6
0
 public void Skip4()
 {
     buf = new FlexBuffer(new byte[] { 1, 2 });
     buf.Skip(2, false);
     CheckBuf(2, 2, 0);
 }
Esempio n. 7
0
 public void Skip3()
 {
     buf = new FlexBuffer(new byte[] { });
     buf.Skip(0, false);
     CheckBuf(0, 0, 0);
 }
Esempio n. 8
0
 public void Skip2()
 {
     buf = new FlexBuffer(new byte[] { 1, 2 });
     buf.Skip(3, false);
 }
Esempio n. 9
0
 public void Skip1()
 {
     buf = new FlexBuffer(new byte[] { });
     buf.Skip(-1, false);
 }