Instance Method

write:maxLength:

Writes the contents of a provided data buffer to the receiver.

Declaration

- (NSInteger)write:(const uint8_t *)buffer maxLength:(NSUInteger)len;

Parameters

buffer

The data to write.

length

The length of the data buffer, in bytes.

Return Value

A number indicating the outcome of the operation:

  • A positive number indicates the number of bytes written.

  • 0 indicates that a fixed-length stream and has reached its capacity.

  • -1 means that the operation failed; more information about the error can be obtained with streamError.

See Also

Using Streams

hasSpaceAvailable

A boolean value that indicates whether the receiver can be written to.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software