Contents

replaceSubrange(_:with:)

Replace a range of bytes in the block buffer.

Declaration

mutating func replaceSubrange(_ range: Range<Int>, with bytes: some DataProtocol)

Parameters

  • range:

    Range of bytes to replace within this buffer. The count of this range must match the count of bytes.

  • bytes:

    The replacement data.

Discussion

This function also works if the range covers non-contiguous regions of memory.