Skip to content

Commit 4c39d68

Browse files
author
Frederick Kellison-Linn
committed
Update documentation
1 parent 1b3bc23 commit 4c39d68

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Foundation/NSData.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,17 @@ open class NSMutableData : NSData {
945945

946946
}
947947

948+
/// Replaces the bytes in `range` with `replacementLength` bytes
949+
/// beginning from the location pointed to by `replacementBytes`.
950+
///
951+
/// - Parameter range: range of bytes in `self` to be replaced.
952+
/// - Parameter replacementBytes: pointer to beginning of buffer
953+
/// where replacement bytes can be found.
954+
/// - Parameter replacementLength: the number of bytes to copy from
955+
/// `replacementBytes`.
956+
///
957+
/// - Note: `replacementLength` must be less than or equal to the
958+
/// size of the buffer pointed to by `replacementBytes`.
948959
open func replaceBytes(in range: NSRange, withBytes replacementBytes: UnsafeRawPointer?, length replacementLength: Int) {
949960
let bytePtr = replacementBytes?.bindMemory(to: UInt8.self, capacity: replacementLength)
950961
CFDataReplaceBytes(_cfMutableObject, CFRangeMake(range.location, range.length), bytePtr, replacementLength)

0 commit comments

Comments
 (0)