             sent = false
         }
 
+        func send(_ string: String) throws {
+            guard let data = string.data(using: .utf8) else {
+                throw DataError(kind: .dataCodingError(string: string))
+            }
+            try send(data)
+        }
+
         func send(_ data: Data) throws {
             guard !sent else {
                 currentIndex += data.count


extension StreamResponse {
    private class SocketStream: WriteSocket {
        private static let CRLF = "\r\n".data(using: .utf8)!
        private let socket: Socket
        init(socket: Socket) {

/// Protocol for writing to socket in stream
public protocol WriteSocket {
    func send(_ data: Data) throws
    func send(_ string: String) throws
}

/// Response with stream
