|
@@ -108,10 +108,14 @@ public class Socket: Hashable, Equatable {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public func writeUTF8(string: String) throws {
|
|
public func writeUTF8(string: String) throws {
|
|
|
- try writeUInt8([UInt8](string.utf8))
|
|
|
|
|
|
|
+ try writeUInt8(ArraySlice(string.utf8))
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public func writeUInt8(data: [UInt8]) throws {
|
|
public func writeUInt8(data: [UInt8]) throws {
|
|
|
|
|
+ try writeUInt8(ArraySlice(data))
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public func writeUInt8(data: ArraySlice<UInt8>) throws {
|
|
|
try data.withUnsafeBufferPointer {
|
|
try data.withUnsafeBufferPointer {
|
|
|
var sent = 0
|
|
var sent = 0
|
|
|
while sent < data.count {
|
|
while sent < data.count {
|