NSInputStream.Read Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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
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).