Ejemplo n.º 1
0
        public override ByteBuf SetBytes(int index, ByteBuf src, int srcIndex, int length)
        {
            CheckSrcIndex(index, length, srcIndex, src.Capacity);
            if (length == 0)
            {
                return(this);
            }

            int i = ToComponentIndex(index);

            while (length > 0)
            {
                Component c           = _components[i];
                ByteBuf   s           = c._buf;
                int       adjustment  = c._offset;
                int       localLength = Math.Min(length, s.Capacity - (index - adjustment));
                s.SetBytes(index - adjustment, src, srcIndex, localLength);
                index    += localLength;
                srcIndex += localLength;
                length   -= localLength;
                i++;
            }
            return(this);
        }
Ejemplo n.º 2
0
 public override ByteBuf SetBytes(int index, sbyte[] src, int srcIndex, int length)
 {
     _buffer.SetBytes(index, src, srcIndex, length);
     return(this);
 }
Ejemplo n.º 3
0
 public override ByteBuf SetBytes(int index, sbyte[] src, int srcIndex, int length)
 {
     CheckIndex(index, length);
     _buffer.SetBytes(index + _adjustment, src, srcIndex, length);
     return(this);
 }