WritableStream
public protocol WritableStream : AnyObject, TextOutputStream
An output stream, like standard output or a writeable file.
-
Undocumented
Declaration
Swift
var encoding: String.Encoding { get set } -
Undocumented
Declaration
Swift
var filehandle: FileHandle { get } -
write(_:)Default implementationWrites
xto the stream.Default Implementation
Undocumented
Declaration
Swift
func write(_ x: String) -
close()Default implementationCloses the stream. Must be called on non-file streams when finished writing, to prevent deadlock when reading.
Default Implementation
Declaration
Swift
func close()
-
print(_:separator:terminator:)Extension methodWrites the textual representations of the given items into the stream. Works exactly the same way as
printfrom Swift’s standard library.To avoid printing a newline at the end, pass
terminator: ""or usewriteìnstead.Declaration
Swift
@warn_unqualified_access public func print(_ items: Any..., separator: String = " ", terminator: String = "\n")Parameters
itemsZero or more items to print, converted to text with String(describing:).
separatorWhat to print between each item. Default is “ ”.
terminatorWhat to print at the end. Default is newline.
-
write(data:)Extension methodWrites data to the stream.
Declaration
Swift
public func write(data: Data)
View on GitHub
WritableStream Protocol Reference