Skip to content

Commit dd9e438

Browse files
committed
Quick fix for conflicting commits.
1 parent 31bf0ab commit dd9e438

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Foundation/NSJSONSerialization.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ public class JSONSerialization : NSObject {
161161
public class func writeJSONObject(_ obj: AnyObject, toStream stream: NSOutputStream, options opt: WritingOptions) throws -> Int {
162162
let jsonData = try data(withJSONObject: obj, options: opt)
163163
let jsonNSData = jsonData.bridge()
164-
return stream.write(UnsafeMutablePointer<UInt8>(jsonNSData.bytes), maxLength: jsonNSData.length)
164+
let bytePtr = jsonNSData.bytes.bindMemory(to: UInt8.self, capacity: jsonNSData.length)
165+
return stream.write(bytePtr, maxLength: jsonNSData.length)
165166
}
166167

167168
/* Create a JSON object from JSON data stream. The stream should be opened and configured. All other behavior of this method is the same as the JSONObjectWithData:options:error: method.

0 commit comments

Comments
 (0)