IPAddress.TryWriteBytes(Span<Byte>, Int32) Method

Definition

Tries to write the current IP address into a span of bytes in network order.

public:
 bool TryWriteBytes(Span<System::Byte> destination, [Runtime::InteropServices::Out] int % bytesWritten);
public bool TryWriteBytes (Span<byte> destination, out int bytesWritten);
member this.TryWriteBytes : Span<byte> * int -> bool
Public Function TryWriteBytes (destination As Span(Of Byte), ByRef bytesWritten As Integer) As Boolean

Parameters

destination
Span<Byte>

When this method returns, the IP address as a span of bytes.

bytesWritten
Int32

When this method returns, the number of bytes written into the span.

Returns

true if the IP address is successfully written to the given span; otherwise, false.

Applies to