Writes the string to the stream.
a Stream object
a string
optional Cancellable object, or null
the number of characters written or -1 on error.