Foundation.NSInputStream Class
A read-only input NSStream.

See Also: NSInputStream Members

Syntax

[Foundation.Register("NSInputStream", true)]
public class NSInputStream : NSStream

Remarks

Subclassing NSInputStream.

NSInputStream is a concrete subclass of NSStream you can use to give read-only access to stream data. For most cases this is sufficient, however if you want more control over the data, you can subclass NSInputStream. If you subclass NSInputStream you must provide an implementation of the following methods:

Providing a toll-free bridged NSInputStream subclass.

The methods required to provide a toll-free bridged NSInputStream subclass are considered private API, and may cause Apple to reject your app from the App Store.

An simple NSInputStream subclass will not work for all API that takes an NSInputStream. This is the case with Foundation.NSMutableUrlRequest for instance, which actually expects an instance of a CFReadStream object. For this to work our NSInputStream subclass needs to be toll-free bridged to CFReadStream. This is done by overriding the following methods:

You must call also NSInputStream.Notify((valuetype CoreFoundation.CFStreamEventType) to inform the client when you have data available (or when you have any other relevant event), otherwise your input stream won't be read from.

Related content

Requirements

Namespace: Foundation
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0