Initializer

init(url:append:)

Returns an initialized output stream for writing to a specified URL.

Declaration

init?(url: URL, append shouldAppend: Bool)

Parameters

url

The URL to the file the output stream will write to.

shouldAppend

true if newly written data should be appended to any existing file contents, otherwise false.

Return Value

An initialized output stream that can write to url.

Discussion

The stream must be opened before it can be used.

See Also

Creating Streams

class func toMemory() -> Self

Creates and returns an initialized output stream that will write stream data to memory.

init(toMemory: ())

Returns an initialized output stream that will write to memory.

init(toBuffer: UnsafeMutablePointer<UInt8>, capacity: Int)

Returns an initialized output stream that can write to a provided buffer.

init?(toFileAtPath: String, append: Bool)

Returns an initialized output stream for writing to a specified file.