Instance Method

getBuffer:length:

Returns by reference a pointer to a read buffer and, by reference, the number of bytes available, and returns a Boolean value that indicates whether the buffer is available.

Declaration

- (BOOL)getBuffer:(uint8_t * _Nullable *)buffer length:(NSUInteger *)len;

Parameters

buffer

Upon return, contains a pointer to a read buffer. The buffer is only valid until the next stream operation is performed.

len

Upon return, contains the number of bytes available.

Return Value

YES if the buffer is available, otherwise NO.

Subclasses of NSInputStream may return NO if this operation is not appropriate for the stream type.

See Also

Using Streams

- read:maxLength:

Reads up to a given number of bytes into a given buffer.

hasBytesAvailable

A Boolean value that indicates whether the receiver has bytes available to read.