 
         return try writeData(data)
     }
-}
+
+    public func writeChar(_ character: UnicodeScalar) throws -> Int{
+        let stringEquiv = String(character)
+        let bytesWritten = try writeString(stringEquiv)
+        return bytesWritten
+    }
+}

            data = Data(bytes: buffer, count: bytesRead)
        } else {
            //This is to avoid the case where bytesRead can be negative causing problems allocating the Data buffer
       	    data = Data(bytes: buffer, count: 0)
        }

        return data

        let newlineChar = CChar(10) // Newline/Line feed character `\n` is 10
        return try readUntilChar(newlineChar)
    }

    public func readChar() throws -> UnicodeScalar {
        let buffer = UnsafeMutablePointer<UInt8>.allocate(capacity: 1)
        
        defer {
            buffer.deallocate(capacity: 1)
        }

        while true {
            let bytesRead = try readBytes(into: buffer, size: 1)

            if bytesRead > 0 {
                let character = UnicodeScalar(buffer[0])
                return character     
            }
        }         

    }

}

// MARK: Transmitting
