Class NearbyBytesPayload
- Namespace
- Plugin.Maui.NearbyConnectivity
- Assembly
- Plugin.Maui.NearbyConnectivity.dll
Represents a payload that contains raw bytes.
public sealed class NearbyBytesPayload : NearbyPayload, IDisposable
- Inheritance
-
NearbyBytesPayload
- Implements
- Inherited Members
Remarks
A byte payload is limited to MaxBytesPayloadLength bytes on every platform. Send larger data as a file.
Constructors
NearbyBytesPayload(ReadOnlyMemory<byte>)
Initializes a new instance of the NearbyBytesPayload class.
public NearbyBytesPayload(ReadOnlyMemory<byte> data)
Parameters
dataReadOnlyMemory<byte>The bytes that were sent or received.
Properties
Data
Gets the bytes that were sent or received.
public ReadOnlyMemory<byte> Data { get; }
Property Value
- ReadOnlyMemory<byte>
The payload's data. Read it through Span: for example
Encoding.UTF8.GetString(payload.Data.Span).
Remarks
A ReadOnlyMemory<T> rather than an array, so the buffer cannot be mutated through this property and no defensive copy is needed to hand it out.