You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Replace inline buffer with withUnsafeTemporaryAllocation
* Fix Darwin build
* Move deprecated APIs off of internal implementations
* Move copyBytes(to:) implementation to DataProtocol file
* Don't calculate buffer length twice
* Align Data mirror children size with Array
/// Copy a subset of the contents of the data to a pointer.
518
-
///
519
-
/// - parameter pointer: A pointer to the buffer you wish to copy the bytes into.
520
-
/// - parameter range: The range in the `Data` to copy.
521
-
/// - warning: This method does not verify that the contents at pointer have enough space to hold the required number of bytes.
522
-
@inlinable // This is @inlinable as trivially forwarding.
523
-
publicfunc copyBytes(to pointer:UnsafeMutablePointer<UInt8>, from range:Range<Index>){
524
-
_copyBytesHelper(to: pointer, from: range)
525
-
}
526
-
527
-
// Copy the contents of the data into a buffer.
528
-
///
529
-
/// This function copies the bytes in `range` from the data into the buffer. If the count of the `range` is greater than `MemoryLayout<DestinationType>.stride * buffer.count` then the first N bytes will be copied into the buffer.
530
-
/// - precondition: The range must be within the bounds of the data. Otherwise `fatalError` is called.
531
-
/// - parameter buffer: A buffer to copy the data into.
532
-
/// - parameter range: A range in the data to copy into the buffer. If the range is empty, this function will return 0 without copying anything. If the range is nil, as much data as will fit into `buffer` is copied.
533
-
/// - returns: Number of bytes copied into the destination buffer.
534
-
@inlinable // This is @inlinable as generic and reasonably small.
535
-
publicfunc copyBytes<DestinationType>(to buffer:UnsafeMutableBufferPointer<DestinationType>, from range:Range<Index>?=nil)->Int{
/// Copy a subset of the contents of the data to a pointer.
262
+
///
263
+
/// - parameter pointer: A pointer to the buffer you wish to copy the bytes into.
264
+
/// - parameter range: The range in the `Data` to copy.
265
+
/// - warning: This method does not verify that the contents at pointer have enough space to hold the required number of bytes.
266
+
@inlinable // This is @inlinable as trivially forwarding.
267
+
publicfunc copyBytes(to pointer:UnsafeMutablePointer<UInt8>, from range:Range<Index>){
268
+
_copyBytesHelper(to: pointer, from: range)
269
+
}
270
+
271
+
// Copy the contents of the data into a buffer.
272
+
///
273
+
/// This function copies the bytes in `range` from the data into the buffer. If the count of the `range` is greater than `MemoryLayout<DestinationType>.stride * buffer.count` then the first N bytes will be copied into the buffer.
274
+
/// - precondition: The range must be within the bounds of the data. Otherwise `fatalError` is called.
275
+
/// - parameter buffer: A buffer to copy the data into.
276
+
/// - parameter range: A range in the data to copy into the buffer. If the range is empty, this function will return 0 without copying anything. If the range is nil, as much data as will fit into `buffer` is copied.
277
+
/// - returns: Number of bytes copied into the destination buffer.
278
+
@inlinable // This is @inlinable as generic and reasonably small.
279
+
publicfunc copyBytes<DestinationType>(to buffer:UnsafeMutableBufferPointer<DestinationType>, from range:Range<Index>?=nil)->Int{
0 commit comments