public override Task <int> SetBytesAsync(int index, Stream src, int length, CancellationToken cancellationToken)
        {
            this.CheckIndex(index, length);
            int read = UnsafeByteBufferUtil.SetBytes(this, this.Addr(index), index, src, length);

            return(Task.FromResult(read));
        }
Ejemplo n.º 2
0
        public override unsafe IByteBuffer SetBytes(int index, IByteBuffer src, int srcIndex, int length)
        {
            this.CheckIndex(index, length);

            fixed(byte *addr = &this.Addr(index))
            UnsafeByteBufferUtil.SetBytes(this, addr, index, src, srcIndex, length);

            return(this);
        }
 public override IByteBuffer SetBytes(int index, byte[] src, int srcIndex, int length)
 {
     this.CheckIndex(index, length);
     UnsafeByteBufferUtil.SetBytes(this, this.Addr(index), index, src, srcIndex, length);
     return(this);
 }