Initializer

init(toMemory:)

Returns an initialized output stream that will write to memory.

Declaration

init(toMemory: ())

Return Value

An initialized output stream that will write stream data to memory.

Discussion

The stream must be opened before it can be used.

The contents of the memory stream are retrieved by passing the constant NSStreamDataWrittenToMemoryStreamKey to property(forKey:).

See Also

Creating Streams

class func toMemory() -> Self

Creates and returns an initialized output stream that will write stream data 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.

init?(url: URL, append: Bool)

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