copy method
Copies items from this buffer to the destination (dst) buffer.
Items are copied to dst starting at position dstOffset.
Items are copied from the range [offset : offset+length]. If length is omitted, the range extends to the end of this or [dst] (whichever has the minimum length).
The range must satisfy the relations 0 ≤ offset ≤ offset+length ≤ this.length.
Implementation
void copy(
final Buffer dst, [
final int dstOffset = 0,
final int offset = 0,
final int? length,
]) {
final int rngLength = length ?? min(dst.length - dstOffset, this.length - offset);
final Iterable<int> src = _data.getRange(offset, offset + rngLength);
dst._data.setRange(dstOffset, dstOffset + rngLength, src);
}