Foundation.NSInputStream.GetBuffer Method
This method can return a pointer to a buffer the caller can read data from.

Syntax

[Foundation.Export("getBuffer:length:")]
protected virtual bool GetBuffer (out IntPtr buffer, out nuint len)

Parameters

buffer
Upon return points to the first of an array of bytes where the caller can read bytes from. The buffer is only valid until the next stream operation.
len
Upon return specifies how many bytes can be written to the buffer.

Returns

A boolean value indicating whether the returned buffer is valid or not.

Remarks

It is recommended to just return false from this method. An implementation must ensure that the returned byte pointer is not moved or collected by the garbage collector until the next stream operation is performed. One way of accomplishing this is with a pinned byte array (pinned with a GCHandle).

Requirements

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