Example #1
0
 public void Write(byte[] value)
 {
     fixed(byte *pv = value)
     {
         FastCopy.CopyBytes(_buffer + *_position, pv, value.Length);
         *_position += value.Length;
     }
 }
Example #2
0
        public void test_fast_copy()
        {
            const int count    = 23;
            var       expected = Utility.GetTestArray(count);
            var       actual   = new byte[count];

            Assert.IsFalse(Utility.CheckTestArray(actual));

            FastCopy.CopyBytes(actual, expected);

            Assert.IsTrue(Utility.CheckTestArray(actual));
        }
Example #3
0
        public byte[] ReadBytes(int length)
        {
            var value = new byte[length];

            fixed(byte *pv = value)
            {
                FastCopy.CopyBytes(pv, _buffer + *_position, length);
                *_position += length;
            }

            return(value);
        }