public override IByteBuf SetBytes(int index, IByteBuf src, int srcIndex, int length) { CheckSrcIndex(index, length, srcIndex, src.ReadableBytes); if (src.HasArray) { Buffer.SetRange(index, src.InternalArray().Slice(srcIndex, length)); } else { src.ReadBytes(Buffer, srcIndex, length); } return(this); }
public override IByteBuf GetBytes(int index, IByteBuf destination, int dstIndex, int length) { CheckDstIndex(index, length, dstIndex, destination.Capacity); if (destination.HasArray) { GetBytes(index, destination.InternalArray(), dstIndex, length); } else { destination.SetBytes(dstIndex, this, index, length); } return(this); }
public override IByteBuf SetBytes(int index, IByteBuf src, int srcIndex, int length) { CheckSrcIndex(index, length, srcIndex, src.ReadableBytes); if (src.HasArray) { InternalBuffer.SetRange(index, src.InternalArray().Slice(srcIndex, length)); } else { var tempBuffer = new byte[length]; src.ReadBytes(tempBuffer, srcIndex, length); InternalBuffer.SetRange(index, tempBuffer); } return(this); }
public override IByteBuf WriteBytes(IByteBuf src, int srcIndex, int length) { EnsureWritable(length); if (src.HasArray) { InternalBuffer.DirectBufferWrite(src.InternalArray().Slice(srcIndex, length)); src.SetReaderIndex(src.ReaderIndex + length); } else { var tempBuffer = new byte[length]; src.ReadBytes(tempBuffer, srcIndex, length); InternalBuffer.DirectBufferWrite(tempBuffer); } return(this); }
public override byte[] InternalArray() { return(_buffer.InternalArray()); }
public override IByteBuf WriteBytes(IByteBuf src, int srcIndex, int length) { EnsureWritable(length); if (src.HasArray) { InternalBuffer.DirectBufferWrite(src.InternalArray().Slice(srcIndex, length)); src.SetReaderIndex(src.ReaderIndex + length); } else { var tempBuffer = new byte[length]; src.ReadBytes(tempBuffer, srcIndex, length); InternalBuffer.DirectBufferWrite(tempBuffer); } return this; }
public override IByteBuf SetBytes(int index, IByteBuf src, int srcIndex, int length) { CheckSrcIndex(index, length, srcIndex, src.ReadableBytes); if (src.HasArray) { InternalBuffer.SetRange(index, src.InternalArray().Slice(srcIndex, length)); } else { var tempBuffer = new byte[length]; src.ReadBytes(tempBuffer, srcIndex, length); InternalBuffer.SetRange(index, tempBuffer); } return this; }
public override IByteBuf SetBytes(int index, IByteBuf src, int srcIndex, int length) { CheckSrcIndex(index, length, srcIndex, src.ReadableBytes); if (src.HasArray) { Buffer.SetRange(index, src.InternalArray().Slice(srcIndex, length)); } else { src.ReadBytes(Buffer, srcIndex, length); } return this; }
public override IByteBuf GetBytes(int index, IByteBuf destination, int dstIndex, int length) { CheckDstIndex(index, length, dstIndex, destination.Capacity); if (destination.HasArray) { GetBytes(index, destination.InternalArray(), dstIndex, length); } else { destination.SetBytes(dstIndex, this, index, length); } return this; }