Type Method

outputStreamToBuffer:capacity:

Creates and returns an initialized output stream that can write to a provided buffer.

Declaration

+ (instancetype)outputStreamToBuffer:(uint8_t *)buffer capacity:(NSUInteger)capacity;

Parameters

buffer

The buffer the output stream will write to.

capacity

The size of the buffer in bytes.

Return Value

An initialized output stream that can write to buffer.

Discussion

The stream must be opened before it can be used.

When the number of bytes written to buffer has reached capacity, the stream’s streamStatus will return NSStreamStatusAtEnd.

See Also

Creating Streams

+ outputStreamToMemory

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

+ outputStreamToFileAtPath:append:

Creates and returns an initialized output stream for writing to a specified file.

+ outputStreamWithURL:append:

Creates and returns an initialized output stream for writing to a specified URL.

- initToMemory

Returns an initialized output stream that will write to memory.

- initToBuffer:capacity:

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

- initToFileAtPath:append:

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

- initWithURL:append:

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