@@ -20,21 +20,21 @@ import CoreFoundation
20
20
import Dispatch
21
21
22
22
23
- /// Turn `NSData ` into `dispatch_data_t `
23
+ /// Turn `Data ` into `DispatchData `
24
24
internal func createDispatchData( _ data: Data ) -> DispatchData {
25
25
//TODO: Avoid copying data
26
26
let buffer = UnsafeRawBufferPointer ( start: data. _backing. bytes,
27
27
count: data. count)
28
28
return DispatchData ( bytes: buffer)
29
29
}
30
30
31
- /// Copy data from `dispatch_data_t ` into memory pointed to by an `UnsafeMutableBufferPointer`.
31
+ /// Copy data from `DispatchData ` into memory pointed to by an `UnsafeMutableBufferPointer`.
32
32
internal func copyDispatchData< T> ( _ data: DispatchData , infoBuffer buffer: UnsafeMutableBufferPointer < T > ) {
33
33
precondition ( data. count <= ( buffer. count * MemoryLayout < T > . size) )
34
34
_ = data. copyBytes ( to: buffer)
35
35
}
36
36
37
- /// Split `dispatch_data_t ` into `(head, tail)` pair.
37
+ /// Split `DispatchData ` into `(head, tail)` pair.
38
38
internal func splitData( dispatchData data: DispatchData , atPosition position: Int ) -> ( DispatchData , DispatchData ) {
39
39
return ( data. subdata ( in: 0 ..< position) , data. subdata ( in: position..< data. count) )
40
40
}
@@ -57,7 +57,7 @@ internal enum _HTTPBodySourceDataChunk {
57
57
case error
58
58
}
59
59
60
- /// A HTTP body data source backed by `dispatch_data_t `.
60
+ /// A HTTP body data source backed by `DispatchData `.
61
61
internal final class _HTTPBodyDataSource {
62
62
var data : DispatchData !
63
63
init ( data: DispatchData ) {
@@ -91,7 +91,7 @@ extension _HTTPBodyDataSource : _HTTPBodySource {
91
91
///
92
92
/// This allows non-blocking streaming of file data to the remote server.
93
93
///
94
- /// The source reads data using a `dispatch_io_t ` channel, and hence reading
94
+ /// The source reads data using a `DispatchIO ` channel, and hence reading
95
95
/// file data is non-blocking. It has a local buffer that it fills as calls
96
96
/// to `getNextChunk(withLength:)` drain it.
97
97
///
0 commit comments