Type Method

inputStreamWithData:

Creates and returns an initialized NSInputStream object for reading from a given NSData object.

Declaration

+ (instancetype)inputStreamWithData:(NSData *)data;

Parameters

data

The data object from which to read. The contents of data are copied.

Return Value

An initialized NSInputStream object for reading from data. If data is not an NSData object, this method returns nil.

Discussion

The stream must be opened before it can be used.

See Also

Creating Streams

+ inputStreamWithFileAtPath:

Creates and returns an initialized NSInputStream object that reads data from the file at a given path.

+ inputStreamWithURL:

Creates and returns an initialized NSInputStream object that reads data from the file at a given URL.

- initWithData:

Initializes and returns an NSInputStream object for reading from a given NSData object.

- initWithFileAtPath:

Initializes and returns an NSInputStream object that reads data from the file at a given path.

- initWithURL:

Initializes and returns an NSInputStream object that reads data from the file at a given URL.