AK.F1.Timing.Server.IO.ByteBuffer.Append C# (CSharp) Метод

Append() публичный Метод

Appends the specified buffer to this buffer.
/// Thrown when this instance has been disposed of. /// /// Thrown when the buffer is unable to be appended. ///
public Append ( byte buffer ) : void
buffer byte The buffer to append.
Результат void
        public void Append(byte[] buffer)
        {
            Guard.NotNull(buffer, "buffer");

            EnsureCapacity(buffer.Length);
            Buffer.BlockCopy(buffer, 0, _buffer, _count, buffer.Length);
            _count += buffer.Length;
        }

Usage Example

Пример #1
0
        public void append_doubles_capacity_until_it_can_satisfy_the_buffer()
        {
            var buffer = new ByteBuffer(1);

            buffer.Append(new byte[1]);
            Assert.Equal(1, buffer.Capacity);

            buffer.Append(new byte[1]);
            Assert.Equal(2, buffer.Capacity);

            buffer.Append(new byte[10]);
            Assert.Equal(16, buffer.Capacity);
        }
All Usage Examples Of AK.F1.Timing.Server.IO.ByteBuffer::Append