Type Method

toMemory()

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

Declaration

class func toMemory() -> Self

Return Value

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

Discussion

The stream must be opened before it can be used.

You retrieve the contents of the memory stream by sending the message property(forKey:) to the receiver with an argument of NSStreamDataWrittenToMemoryStreamKey.

See Also

Creating Streams

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.

init?(url: URL, append: Bool)

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