Edit

Share via


NSInputStream.Read Method

Definition

Overloads

Read(Byte[], nuint)

Reads data from the stream into the provided buffer.

Read(IntPtr, nuint)

Reads data from the stream into the provided buffer. You should not call this method directly, you should call M:Foundation.NSInputStream.Read(byte[],uint) instead. This method is for NSInputStream subclasses to implement.

Read(Byte[], Int32, nuint)

Read(Byte[], nuint)

Reads data from the stream into the provided buffer.

public nint Read (byte[] buffer, nuint len);
member this.Read : byte[] * nuint -> nint

Parameters

buffer
Byte[]

The buffer where data should be put.

len
System.System.UIntPtr System.unativeint

The size of the buffer (in bytes).

Returns

System.System.IntPtr System.nativeint

The number of bytes actually written.

Applies to

Read(IntPtr, nuint)

Reads data from the stream into the provided buffer. You should not call this method directly, you should call M:Foundation.NSInputStream.Read(byte[],uint) instead. This method is for NSInputStream subclasses to implement.

[Foundation.Export("read:maxLength:")]
public virtual nint Read (IntPtr buffer, nuint len);
abstract member Read : nativeint * nuint -> nint
override this.Read : nativeint * nuint -> nint

Parameters

buffer
IntPtr

nativeint

The buffer where data should be put.

len
System.System.UIntPtr System.unativeint

The size of the buffer (in bytes).

Returns

System.System.IntPtr System.nativeint

The number of bytes actually written.

Attributes

Remarks

You can use methods in T:System.Runtime.InteropServices.Marshal to write to the buffer (for instance: M:System.Runtime.InteropServices.Marshal.Copy(byte[],int,IntPtr,int) to write from a byte array).

Applies to

Read(Byte[], Int32, nuint)

public nint Read (byte[] buffer, int offset, nuint len);
member this.Read : byte[] * int * nuint -> nint

Parameters

buffer
Byte[]
offset
Int32
len
System.System.UIntPtr System.unativeint

Returns

System.System.IntPtr System.nativeint

Applies to